Actually I found the answer:
public static Bitmap loadBitmapFromView(View v) {
Bitmap b = Bitmap.createBitmap(v.getWidth() , v.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
v.draw(c);
return b;
}
More Related Contents:
- How to programmatically take a screenshot on Android?
- How to prevent Screen Capture in Android
- How to take a screenshot of a current Activity and then share it?
- Android take screen shot programmatically
- Take Screenshot of SurfaceView
- Screen Capture in android
- How to record screen and take screenshots, using Android API?
- Android take screenshot via code
- Programmatic screencapture on mobile device
- Taking screenshot programmatically doesnt capture the contents of surfaceVIew
- android taking screenshot of offscreen page
- Taking a “screenshot” of a specific layout in Android
- Android get screenshot of all ListView items
- VideoView getDrawingCache is returning black
- how to create and save a screenshot from a surfaceview?
- How can I programmatically take a screenshot of a webview, capturing the full page?
- How to take a screenshot and share it programmatically
- Disable Screen Capture/ScreenShot in React Native App
- view.getDrawingCache() is deprecated in Android API 28
- How to take emulator screenshots using Eclipse?
- how to design form like google calender event in android? [closed]
- Best practice for storing and protecting private API keys in applications [closed]
- Counting Chars in EditText Changed Listener
- Dual SIM card Android
- Neither user 10102 nor current process has android.permission.READ_PHONE_STATE
- Android update TextView in Thread and Runnable
- Views overlayed above YouTubePlayerFragment or YouTubePlayerView in the layout hierarchy cause playback to pause immediately
- Error : ConnectionResult{statusCode=INTERNAL_ERROR, resolution=null}
- Debugging with Android Studio stuck at “Waiting For Debugger” forever
- Is there an example of how to use a TouchDelegate in Android to increase the size of a view’s click target?