I want to save off a Bitmap of the current screen for my users to share, but I only want to do a partial (I want to remove the areas that have user buttons and such).
I have found code on taking a full screenshot, but cannot figure out how to do this.
Hoping there is something easy that I am just missing.
Thanks in advance.
Press Ctrl + PrtScn keys. The entire screen changes to gray including the open menu. Select Mode, or in earlier versions of Windows, select the arrow next to the New button. Select the kind of snip you want, and then select the area of the screen capture that you want to capture.
Snip for Android can be downloaded from the Google Play Store. The Android app can be used on mobile and tablet devices.
Put the partial area of which the screenshot is to be taken in a ViewGRoup
say RelativeLayout
. Then when you launch the Activity
just make sure to build the drawing cache as follows
relativeLayout = (RelativeLayout)findViewById(R.id.relativeLayout);
relativeLayout.setDrawingCacheEnabled(true);
relativeLayout.buildDrawingCache();
And then when you actually want ot take the screenshot of that particular area, just get the Screenshot in the form of a Bitmap
from the drawing cache
bitmap = relativeLayout.getDrawingCache();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With