FileInputStream fs = null;
try {
BitmapFactory.Options options = new BitmapFactory.Options();
options.outWidth = 10;
options.outHeight = 10;
options.inSampleSize = 10;// 特别注意,这个值越大,相片质量越差,图像越小
options.inPreferredConfig = Bitmap.Config.ARGB_4444;
options.inPurgeable = true;
options.inInputShareable = true;
options.inDither = false;
options.inTempStorage = new byte[12 * 1024];
try {
fs = new FileInputStream(new File(filePath));
} catch (FileNotFoundException e) {
e.printStackTrace();
}


drawable = BitmapFactory.decodeFileDescriptor(fs.getFD(),
null, options);
imgMaps.put(filePath, new SoftReference<Bitmap>(drawable));
} catch (Exception e) {
return null;
} finally {
if (fs != null) {
try {
fs.close();
} catch (IOException e) {
e.printStackTrace();
}
}
}

更多相关文章

  1. Android开源框架----1. SmartImageView图像视图
  2. Android(安卓)识别手指个数
  3. Android(安卓)使用OPENCV实现图像实时对比
  4. 初学Android,图形图像之使用drawBitmapMesh扭曲图像(三十二)
  5. 你不知道的Android着色器/渲染器
  6. Android中的图像处理
  7. Android(安卓)Paint之shader(图像渲染)
  8. Android中的SurfaceTexture
  9. Android(安卓)Bitmap图像效果处理

随机推荐

  1. Android自动化测试框架开发(二)Monkey、Mon
  2. Android(安卓)中 shape 图形的使用
  3. 删除Android工程中冗余资源
  4. Android(安卓)学习 之 API文档汇总(不断更
  5. android性能测试方法
  6. Android(安卓)- Unparsed aapt error(s)
  7. Android获取软键盘输入内容
  8. Android作为Socket服务器端
  9. Android Handler机制剖析
  10. Android实现XML解析技术