参考:https://blog.csdn.net/u012587637/article/details/41007077
public static Bitmap getBitmapFromPath(String path){
if (!new File(path).exists()) {
return null;
}
//最大读取10M的图片
byte[] buf = new byte[1024*1024*10];
Bitmap bitmap = null;
try {
FileInputStream fis = new FileInputStream(path);
int len = fis.read(buf, 0, buf.length);
bitmap = BitmapFactory.decodeByteArray(buf, 0, len);
if (bitmap == null) {
return null;
}
fis.close();
} catch (Exception e) {
return null;
}
return bitmap;
}