获取相机返回的BitMap

Uri uri = data.getData();
Bitmap bitmap = null;
switch (requestCode){
case 1:
if(uri!=null){
try {
bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(),uri);
} catch (IOException e) {
e.printStackTrace();
}
}else {
Bundle bundle = data.getExtras();
bitmap = bundle.getParcelable(“data”);
}

你可能感兴趣的:(获取相机返回的BitMap)