(转自:http://blog.sina.com.cn/s/blog_5de73d0b0100zfm8.html)
1 private Bitmap getBitmapFromUri(Uri uri) 2 { 3 try 4 { 5 // 读取uri所在的图片 6 Bitmap bitmap = MediaStore.Images.Media.getBitmap(this.getContentResolver(), uri); 7 return bitmap; 8 } 9 catch (Exception e) 10 { 11 Log.e("[Android]", e.getMessage()); 12 Log.e("[Android]", "目录为:" + uri); 13 e.printStackTrace(); 14 return null; 15 } 16 }