错误: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) |