BitmapFactory.Options.inPurgeable

  1. BitmapFactory.Options.inPurgeable; 
  2.       
  3.      如果 inPurgeable 设为True的话表示使用BitmapFactory创建的Bitmap 
  4.      用于存储Pixel(像数)的内存空间在系统内存不足时可以被回收, 
  5.      在应用需要再次访问Bitmap的Pixel时(如绘制Bitmap或是调用getPixel), 
  6.      系统会再次调用BitmapFactory decoder(解码)重新生成Bitmap的Pixel数组。  
  7.      为了能够重新解码图像,bitmap要能够访问存储Bitmap的原始数据。 
  8.       
  9.      在inPurgeable为false时表示创建的Bitmap的Pixel内存空间不能被回收, 
  10.      这样BitmapFactory在不停decodeByteArray创建新的Bitmap对象时候, 
  11.      不同设备的内存不同,因此能够同时创建的Bitmap个数可能有所不同, 
  12.      200个bitmap足以使大部分的设备重新OutOfMemory错误。 
  13.      当isPurgable设为true时,系统中内存不足时, 
  14.      可以回收部分Bitmap占据的内存空间,这时一般不会出现OutOfMemory 错误。 
  15. options.inPurgeable =true;

    options.inInputShareable =true;

    inInputShareable:设置是否深拷贝,与inPurgeable结合使用,inPurgeable为false时,该参数无意义。 
                                      True:  share  a reference to the input data(inputStream, array,etc) 。 False :a deep copy。 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值