/**
*
* @param path
* 存放文件的绝对路径
* @param width
* 需要显示照片的宽度
* @param heigh
* 需要显示照片的高度
* @return
*/
private static Bitmap getBitmap(String path, int width, int heigh) {
Options op = new Options();
op.inJustDecodeBounds = true;
Bitmap bt = BitmapFactory.decodeFile(path, op);
int xScale = op.outWidth / width;
int yScale = op.outHeight / heigh;
op.inSampleSize = xScale > yScale ? xScale : yScale;
op.inJustDecodeBounds = false;
bt = BitmapFactory.decodeFile(path, op);
return bt;
}
关于加载照片内存溢出问题
最新推荐文章于 2022-04-17 00:45:00 发布