Android Utililty Methods Screenshort Take

List of utility methods to do Screenshort Take

Description

The list of methods to do Screenshort Take are organized into topic(s).

Method

BitmaptakeScreenShot(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()
...
BitmapcutToScreen(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);
Bitmapshot(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();
...
BitmapsnapShotWithoutStatusBar(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;
...
BitmapsnapShotWithStatusBar(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);
...