When you click the button, the gallery opens and when you select an image, the image is loaded into a bitmap It's displayed in the image view When I recall an image, the picture is loaded with a 90-degree rotation to the right.
Is there anything wrong with the sauce below? Thank you^
^protected void onActivityResult(int requestCode, int resultCode, Intent data) {
super.onActivityResult(requestCode, resultCode, data);
if(resultCode == RESULT_OK)
{
if(requestCode == Define.GET_IMAGE)
{
Log.i("sinwhod","a = " + data.getData());
tmpUri = data.getData();
try
{
originalBitmap = MediaStore.Images.Media.getBitmap(getContentResolver(), data.getData());
Bitmap displayBitmp = MediaStore.Images.Media.getBitmap(getContentResolver(), data.getData());
imgvImage.setImageBitmap(resizeBitmap(displayBitmp,200));
}
}
}
}
The framework concept is different for each device (or manufacturer), so there may be operational differences. See the link here for instructions on how to handle rotated images directly. Also, we recommend that you try the image loader such as Picasso
and Glide
.
© 2024 OneMinuteCode. All rights reserved.