开发者

How to get the orientation of a Bitmap in Android

I want to get the orientation of bitmap images. I tried the following-

Bitmap test = MediaStore.Images.Media.getBitmap(getContentResolver(), Uri);
int w = test.getWidth();
int h = test.getHeight();

However开发者_如何学JAVA it returns w=2592 & h=1944 (for all images captured by the camera) irrespective of whether it was taken in landscape or portrait mode. Is this the correct approach or is there any better way to do this?


You need to use ExifInterface if you are using API level 5 or higher. See this post.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜