Open Image from Gallery Only in Potrait mode
if you having an issue with the image rotation well i advice you to use this method as its the simplest and most efficient way.
String[] orientationColumn = { MediaStore.Images.Media.ORIENTATION };
@SuppressWarnings("deprecation")
Cursor cur = managedQuery(imageFileUri, orientationColumn, null,
null, null);
int orientation = -1;
if (cur != null && cur.moveToFirst()) {
orientation = cur.getInt(cur
.getColumnIndex(orientationColumn[0]));
}
Matrix matrix = new Matrix();
matrix.postRotate(orientation);
bmp = Bitmap.createBitmap(bmp, 0, 0, bmp.getWidth(),
bmp.getHeight(), matrix, true);
view.setImageBitmap(bmp);
hope this is what you are looking for :)
.
stackoverflow.comm
No comments:
Post a Comment