Android(安卓)将View转换成Bitmap
16lz
2022-04-17
/**
* 将View转换成Bitmap的方法
* @param view
* @return
*/
public static Bitmap getBitmapFromView(View view)
{
view.measure(MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED), MeasureSpec.makeMeasureSpec(0, MeasureSpec.UNSPECIFIED));
view.layout(0, 0, view.getMeasuredWidth(), view.getMeasuredHeight());
view.buildDrawingCache();
Bitmap bitmap = view.getDrawingCache();
return bitmap;
}
更多相关文章
- Android(安卓)流媒体系列(二)
- Install Android(安卓)Composite ADB Interface driver for Wind
- AppCompat does not support the current theme features的解决
- Android(安卓)Dialog 的使用
- Android获取StatusBa有效高度
- Android中 Bitmap和Drawable相互转换的方法
- android 获取IP
- 浅谈Java中Collections.sort对List排序的两种方法
- Python list sort方法的具体使用