View转换成Bitmap
来源:互联网 发布:淘宝服务.com 编辑:程序博客网 时间:2024/05/19 19:41
public static Bitmap getViewBitmap(View v) { if (v == null) { return null; } try { v.clearFocus(); // v.setPressed(false); // // 能画缓存就返回false boolean willNotCache = v.willNotCacheDrawing(); v.setWillNotCacheDrawing(false); int color = v.getDrawingCacheBackgroundColor(); v.setDrawingCacheBackgroundColor(0); if (color != 0) { v.destroyDrawingCache(); } v.buildDrawingCache(); Bitmap cacheBitmap = v.getDrawingCache(); if (cacheBitmap == null) { return null; } Bitmap bitmap = null; try { bitmap = cacheBitmap.copy(Config.RGB_565, true); } catch (Exception e) { } // Restore the view v.destroyDrawingCache(); v.setWillNotCacheDrawing(willNotCache); v.setDrawingCacheBackgroundColor(color); return bitmap; } catch (OutOfMemoryError ex) { } return null; }
1 0
- View转换成Bitmap
- 将View 转换成 Bitmap
- 将View转换成Bitmap
- 将View转换成Bitmap
- 如何把View转换成Bitmap
- android view转换成bitmap截图
- 把 view 转换成bitmap对象
- android--如何将View转换成Bitmap
- Android 将View转换成BitMap
- Android把View转换成Bitmap
- XML布局View转换成Bitmap
- 如何将view转换成bitmap
- View转换Bitmap
- View转换为Bitmap
- View转换为Bitmap
- View转换为bitmap
- 将View转换成Bitmap的方法,可直接调用
- view存成bitmap
- xml解析
- IOS Assigning to 'id<Delegate>' from incompatible type...解决办法<CALayerDelegate>
- iOS 遍历图片每个像素点并修改rgb值
- MongoDB_MongoDB事务
- 从机器学习谈起(转载)
- View转换成Bitmap
- 高仿QQ源码+客户端+服务端+数据库资源齐全可编译架设外网
- 黑白棋经典残局(9)
- 利用ECharts3来实现ECharts2实例中的模拟迁徙效果,即背景地图为百度地图。
- 将dev gridview中数据原样导出到EXCEL
- adb shell pm list packages: 列出所有的包名
- qq客服,调用qq聊天
- 对于按成本组件结构(要素)还原
- Apache 2.4(一)下载、安装配置与卸载