将View转换成Bitmap的方法,可直接调用
来源:互联网 发布:git 安装使用centos 编辑:程序博客网 时间:2024/06/11 00:29
<pre name="code" class="java">private Bitmap getViewBitmap(View v) { Bitmap bitmap = null; if (v != null) { v.clearFocus(); v.setPressed(false); boolean willNotCache = v.willNotCacheDrawing(); v.setWillNotCacheDrawing(false); int color = v.getDrawingCacheBackgroundColor(); v.setDrawingCacheBackgroundColor(0); float alpha = v.getAlpha(); v.setAlpha(1.0f); if (color != 0) { v.destroyDrawingCache(); } v.buildDrawingCache(); Bitmap cacheBitmap = v.getDrawingCache(); if (cacheBitmap == null) { return null; } bitmap = Bitmap.createBitmap(cacheBitmap); // Restore the view v.destroyDrawingCache(); v.setAlpha(alpha); v.setWillNotCacheDrawing(willNotCache); v.setDrawingCacheBackgroundColor(color); } return bitmap;}
0 0
- 将View转换成Bitmap的方法,可直接调用
- 将View 转换成 Bitmap
- 将View转换成Bitmap
- 将View转换成Bitmap
- android--如何将View转换成Bitmap
- Android 将View转换成BitMap
- 如何将view转换成bitmap
- 获取View的截图-将View转换为Bitmap对象
- View转换成Bitmap
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byt
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- android 将图片内容解析成字节数组,将字节数组转换为ImageView可调用的Bitmap对象,图片缩放,把字节数组保存为一个文件,把Bitmap转Byte
- 将View的内容映射成Bitmap
- 直接将ppt转换成pdf格式的方法
- ALE的应用
- FPGA机器学习之龙星计划机器学习第四堂
- HDOJ-1010(DFS + 奇偶剪枝)
- c语言思想8
- 中国剩余定理---FZU 1402 猪的安家
- 将View转换成Bitmap的方法,可直接调用
- 求余数
- Java:谈谈protected访问权限
- GCC系列教程
- 软件开发者真的需要文凭吗?
- 操作系统简要笔记(二)
- 依瓢画葫芦
- Android学习笔记四(二) 为Activity添加Fragment
- WINAPI学习