1 //通过Uri获取BitMap 2 public static Bitmap getBitmapFromUri(Uri uri,Context context) { 3 Bitmap bitmap = null; 4 try { 5 bitmap= BitmapFactory.decodeFile(uri.toString()); 6 7 } catch (Exception e) { 8 e.printStackTrace(); 9 } 10 return bitmap; 11 }