List of utility methods to do View to Image Capture
Bitmap | getBitmapFromView() get Bitmap From View Bitmap bitmap = null; try { int width = mCreateView.getWidth(); int height = mCreateView.getHeight(); if (width != 0 && height != 0) { bitmap = Bitmap.createBitmap(width, height, Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(bitmap); ... |
Bitmap | getBitmapFromView(View view) get Bitmap From View view.destroyDrawingCache();
view.measure(View.MeasureSpec.makeMeasureSpec(0,
View.MeasureSpec.UNSPECIFIED), View.MeasureSpec
.makeMeasureSpec(0, View.MeasureSpec.UNSPECIFIED));
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
view.setDrawingCacheEnabled(true);
Bitmap bitmap = view.getDrawingCache(true);
return bitmap;
...
|
Bitmap | view2Bitmap(View view) view Bitmap Bitmap bitmap = null; try { if (view != null) { view.setDrawingCacheEnabled(true); view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec .makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); view.layout(0, 0, view.getMeasuredWidth(), ... |
Bitmap | view2Bitmap(View view) view Bitmap Bitmap bitmap = null; try { if (view != null) { view.setDrawingCacheEnabled(true); view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec .makeMeasureSpec(0, MeasureSpec.UNSPECIFIED)); view.layout(0, 0, view.getMeasuredWidth(), ... |