[android] UriからBitmapを作成する

UriからBitmapを作成する

UriからBitmapを作成するには下記の通り

try {
 Bitmap bitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), uri);
}catch (IOException e) {
 e.printStackTrace();
}

*MediaStore.Images.Media.getBitmapはIOExceptionの判定が必要なのでtry/catchを実装しておく

コメントを残す

メールアドレスが公開されることはありません。 が付いている欄は必須項目です