java.lang.OutOfMemoryError: bitmap size exceeds VM budget
来源:互联网 发布:虚拟gps定位软件 ios 编辑:程序博客网 时间:2024/06/06 12:40
public void image(int id) {
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
// 获取这个图片的宽和高
bitmap = BitmapFactory.decodeResource(getResources(), id, options); // 此时返回bm为空
options.inJustDecodeBounds = false;
// 计算缩放比
int be = (int) (options.outHeight / (float) 50);
if (be <= 0)
be = 1;
options.inSampleSize = be;
// 重新读入图片,注意这次要把options.inJustDecodeBounds 设为 false哦
bitmap = BitmapFactory.decodeResource(getResources(), id, options);
int bmpWidth = bitmap.getWidth();
int bmpHeight = bitmap.getHeight();
Log.i("RG", "bmpWidth = " + bmpWidth + ", bmpHeight = " + bmpHeight);
}
BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
// 获取这个图片的宽和高
bitmap = BitmapFactory.decodeResource(getResources(), id, options); // 此时返回bm为空
options.inJustDecodeBounds = false;
// 计算缩放比
int be = (int) (options.outHeight / (float) 50);
if (be <= 0)
be = 1;
options.inSampleSize = be;
// 重新读入图片,注意这次要把options.inJustDecodeBounds 设为 false哦
bitmap = BitmapFactory.decodeResource(getResources(), id, options);
int bmpWidth = bitmap.getWidth();
int bmpHeight = bitmap.getHeight();
Log.i("RG", "bmpWidth = " + bmpWidth + ", bmpHeight = " + bmpHeight);
}
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget解决方法
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget解决办法
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget解决方法
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget解决方法
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget解决方法
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError:bitmap size exceeds VM budget
- java.lang.OutOfMemoryError:bitmap size exceeds VM budget 如何解决
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- 完美解决java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- 完美解决java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- android java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- 关于leap motion的原理和疑点
- Entity Framework 4中删除所有数据行的几种方法
- Android 中弹出对话框 代码
- C语言中scanf函数的详解
- struct 字节对齐问题(不包含struct嵌套的讨论以及修改机器的对齐方式的时候),更详细的请参考收藏
- java.lang.OutOfMemoryError: bitmap size exceeds VM budget
- 用栈写出Fibonacci的递归和不递归程序
- html操作
- C语言中#include "stdafx.h"详解
- C++中typedef struct与struct的区别
- 项目开发和管理需要弄清楚的6个问题
- 关于typedef的用法总结
- RMAN-06214: Datafile Copy
- amcharts js版破解