Chinaunix首页 | 论坛 | 博客
  • 博客访问: 35760
  • 博文数量: 11
  • 博客积分: 1400
  • 博客等级: 上尉
  • 技术积分: 95
  • 用 户 组: 普通用户
  • 注册时间: 2010-02-20 17:13
文章分类

全部博文(11)

文章存档

2010年(11)

我的朋友
最近访客

分类: 嵌入式

2010-02-23 08:59:05


 错误:bitmap size exceeds VM budget

, , , 
在用真机进行测试时,报错:bitmap size exceeds VM budget错误代码指向Bitmap bm = BitmapFactory.decodeFile(path + "/" + fileName);何解?

 发表于 2009-9-1 13:20 | 
是OutOfMemoryError了吧,你多大的图片?

解决方法:
1、调整merory useage
mOptions.inSampleSize = 2;//return an image that is 1/2 the width/height of the original, and 1/4 the number of pixels.

2、调整bitmap size
bitmap = Bitmap.createScaledBitmap(bitmap, 100, 150, false);

3、调整temp storage
mOptions.inSampleSize = new byte[100 * 1024];
参考:
阅读(850) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~