Skip to content

Instantly share code, notes, and snippets.

@aykuttasil
Created March 14, 2016 15:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aykuttasil/da03aef775f9144b6898 to your computer and use it in GitHub Desktop.
Save aykuttasil/da03aef775f9144b6898 to your computer and use it in GitHub Desktop.
public static Bitmap loadBitmapFromView(View v) {
Bitmap b = Bitmap.createBitmap( v.getLayoutParams().width, v.getLayoutParams().height, Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(b);
v.layout(v.getLeft(), v.getTop(), v.getRight(), v.getBottom());
v.draw(c);
return b;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment