Convert View To Bitmap

1
2
3
4
5
6
7
8
public static Bitmap convertViewToBitmap(View 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);
return view.getDrawingCache(true);
}
作者:AngelDevil
出处:http://www.angeldevil.me
原文链接:http://www.angeldevil.me/2014/07/22/Convert-View-To-Bitmap/

转载请注明出处!