Skip to content

Instantly share code, notes, and snippets.

@jilulu
jilulu / BitmapUtils.java
Created December 15, 2017 10:12 — forked from jayrambhia/BitmapUtils.java
Android Background Blur
public static Bitmap getBitmapFromView(View view) {
Bitmap bitmap = Bitmap.createBitmap(view.getWidth(), view.getHeight(), Bitmap.Config.ARGB_8888);
Canvas c = new Canvas(bitmap);
view.layout(view.getLeft(), view.getTop(), view.getRight(), view.getBottom());
view.draw(c);
return bitamp;
}