Sunday, June 30, 2013

[android help] Open Image from Gallery Only in Potrait mode


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

Google Voice on T-Mobile? [General]

Google Voice on T-Mobile? So I recently switched from a GNex on Verizon to a Moto X DE on T-Mobile. I had always used Google Voice for my v...