Skip to content Skip to sidebar Skip to footer

Android Make Screenshot Of Entire Layout

I am doing screenshot and returning a bitmap using the next method. public Bitmap takeScreenShot(View view) { view.setDrawingCacheEnabled(true); view.setDrawingCac

Solution 1:

Try this code:

publicstatic Bitmap getBitmapFromView(View v, int width, int height) {
    Bitmapb= Bitmap.createBitmap(width , height, Bitmap.Config.ARGB_8888);                
    Canvasc=newCanvas(b);
    v.layout(0, 0, v.getLayoutParams().width, v.getLayoutParams().height);
    v.draw(c);
    return b;
}

Edit:

Bitmapbitmap= Bitmap.createBitmap(scrollView.getChildAt(0).getWidth(), scrollView.getChildAt(0).getHeight(), Bitmap.Config.ARGB_8888);

Post a Comment for "Android Make Screenshot Of Entire Layout"