android BitmapFactory.Options 优化bitmap图像
来源:互联网 发布:域名服务器ip地址 编辑:程序博客网 时间:2024/05/27 12:22
在使用 BitmapFactory 解析 bitmap 图像的时候,使用 options 选项可以配置 bitmap 对象的一些属性:
BitmapFactory.Options options = new BitmapFactory.Options();
options.inPreferredConfig = Bitmap.Config.ARGB_4444; // 默认是Bitmap.Config.ARGB_8888
/* 下面两个字段需要组合使用 */options.inPurgeable = true;
options.inInputShareable = true;
Bitmap bmp = BitmapFactory.decodeFile(path, options);
inPurgeable 是控制 Bitmap 对象是否使用软引用机制, 在系统需要的时候可以回收该对象, 如果在此后, 程序又需要使用该对象, 则系统重新 decode 该对象.
inInputShareable 和 inPurgeable 组合使用的, 是控制是否复制 inputfile 对象的引用, 如果不复制, 那么要实现 inPurgeable 机制就需要复制一份 file 数据, 才能在系统需要 decode 的时候创建一个 bitmap 对象.
0 0
- android BitmapFactory.Options 优化bitmap图像
- 关于android缩放bitmap,BitmapFactory.Options.inSampleSize的优化算法
- Bitmap与BitmapFactory.Options
- Android 管理Bitmap内存 及 Bitmap.Config BitmapFactory.Options 说明
- android Bitmap,BitmapFactory类图像处理
- bitmap处理BitmapFactory.Options.inSampleSize
- bitmap处理BitmapFactory.Options.inSampleSize
- Bitmap——BitmapFactory.Options
- android BitmapFactory.Options
- android BitmapFactory.Options
- android BitmapFactory.Options
- android BitmapFactory.Options
- android BitmapFactory.Options
- Android:BitmapFactory.Options
- Android Bitmapfactory.Options
- Android Bitmap图像优化
- Android Bitmap图像优化
- Android Bitmap图像优化
- Working Practice-快速原型模型
- php session学习笔记
- 我的“mtp 该设备无法启动 代码 10”的不法之法..
- Java继承和多态
- mac Sublime Text 2 破解
- android BitmapFactory.Options 优化bitmap图像
- 菜单使用
- Linux中用C语言写系统日志
- 其实Unix很简单
- 虚函数和类的多态性
- 快速排序详解
- Decoding Java.Lang.OutOfMemoryError: PermGen Space
- 一些破事儿
- linux基础命令和知识(二)