Android:从图库加载的位图在 ImageView 中旋转 [英] Android: Bitmaps loaded from gallery are rotated in ImageView

查看:23
本文介绍了Android:从图库加载的位图在 ImageView 中旋转的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我将媒体库中的图像加载到位图时,一切正常,除了垂直握住手机时用相机拍摄的图片被旋转,因此即使出现水平图片,我也总是得到水平图片在画廊垂直.为什么会这样,我如何才能正确加载它?

When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I always get a horizontal picture even though it appears vertical in the gallery. Why is that and how can I load it correctly?

推荐答案

你看过图片的 EXIF 数据了吗?它可能知道拍照时相机的方向.

Have you looked at the EXIF data of the images? It may know the orientation of the camera when the picture was taken.

这篇关于Android:从图库加载的位图在 ImageView 中旋转的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆