【发布时间】:2012-07-08 00:41:24
【问题描述】:
我的代码是:
public Bitmap loadPhoto(Uri uri) {
Bitmap scaled = null;
try {
scalled = Bitmap.createBitmap(
MediaStore.Images.Media.getBitmap(getContentResolver(), uri),
0,0,90, 90);
if (scaled == null) { return null; }
} catch(Exception e) { }
return scaled;
}
在这之后。我在 ImageView 中显示缩放。每张图片都来自设备摄像头。
每次显示相机中的三张照片后,我都会收到错误:内存不足。如何解决?
【问题讨论】:
-
另见 Chet Haase 关于位图缩放的精彩教程:youtube.com/watch?v=12cB7gnL6po
-
请注意此页面已过时 - 今天您只需这样做:stackoverflow.com/a/24135522/294884
-
你有答案吗??请分享代码
标签: android bitmap imageview out-of-memory