Tuesday, 1 September 2015

Capture Screenshot Android Example

public Bitmap captureScreen() {
Bitmap screenshot = null;
try {

screenshot = Bitmap.createBitmap(MmitApp.Context()
.GetScreenResolution().x, MmitApp.Context()
.GetScreenResolution().y, Config.ARGB_8888);
Canvas canvas = new Canvas(screenshot);

                            //if you required to draw any thing during Screen Shot it will be also captured.
                            canvas.drawBitmap(aBitMap, aX, aY, MmitApp.mPaint);

} catch (Exception e) {
Log.d("ScreenShotActivity", "Failed to capture screenshot because:"
+ e.getMessage());
}

return screenshot;
}

No comments:

Post a Comment