List of utility methods to do Screenshort Take
Bitmap | takeScreenShot(Activity activity) take Screen Shot View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap b1 = view.getDrawingCache(); Rect frame = new Rect(); activity.getWindow().getDecorView() .getWindowVisibleDisplayFrame(frame); int width = activity.getWindowManager().getDefaultDisplay() ... |
Bitmap | cutToScreen(Activity activity, Bitmap bitmap) cut To Screen DisplayMetrics dm = new DisplayMetrics(); activity.getWindowManager().getDefaultDisplay().getMetrics(dm); int intScreenWidth = dm.widthPixels; int intScreenHeight = dm.heightPixels; return Bitmap.createBitmap(bitmap, 0, 0, intScreenWidth, intScreenHeight); |
Bitmap | shot(Activity activity) shot View views = activity.getWindow().getDecorView(); views.buildDrawingCache(); Rect frames = new Rect(); views.getWindowVisibleDisplayFrame(frames); int statusBarHeights = frames.top; Display display = activity.getWindowManager().getDefaultDisplay(); int widths = display.getWidth(); int heights = display.getHeight(); ... |
Bitmap | snapShotWithoutStatusBar(Activity activity) snap Shot Without Status Bar View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bmp = view.getDrawingCache(); Rect frame = new Rect(); activity.getWindow().getDecorView() .getWindowVisibleDisplayFrame(frame); int statusBarHeight = frame.top; ... |
Bitmap | snapShotWithStatusBar(Activity activity) snap Shot With Status Bar View view = activity.getWindow().getDecorView(); view.setDrawingCacheEnabled(true); view.buildDrawingCache(); Bitmap bmp = view.getDrawingCache(); int width = getScreenWidth(activity); int height = getScreenHeight(activity); Bitmap bp = null; bp = Bitmap.createBitmap(bmp, 0, 0, width, height); ... |