Layout(View) to Bitmap Converter in Android

Hello friend this Method used for View to Bitmap like take a Screenshot in it.

public Bitmap takeScreenShot(View view) {
view.setDrawingCacheEnabled(true);
view.setDrawingCacheQuality(AccessibilityNodeInfoCompat.ACTION_COLLAPSE);
view.buildDrawingCache();
if (view.getDrawingCache() == null) {
return null;
}
Bitmap snapshot = Bitmap.createBitmap(view.getDrawingCache());
view.setDrawingCacheEnabled(false);
view.destroyDrawingCache();
return snapshot;
}

Its Easy and simple you just give your view and get layout bitmap init.

Thank you friends,

 

Contributer

Some say he’s half man half fish, others say he’s more of a seventy/thirty split. Either way he’s a fishy bastard. Google

0 comments:

Hot-product

Best Watch Store

Popular Posts

Contact Form

Name

Email *

Message *