【问题标题】:How to get the orientation of a Bitmap in Android如何在Android中获取位图的方向
【发布时间】:2011-03-16 19:49:13
【问题描述】:

我想获取位图图像的方向。我尝试了以下-

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

但是它返回 w=2592 & h=1944(对于相机捕获的所有图像),无论它是在横向还是纵向模式下拍摄的。这是正确的方法还是有更好的方法来做到这一点?

【问题讨论】:

    标签: android


    【解决方案1】:

    如果您使用 API 级别 5 或更高级别,则需要使用 ExifInterface。见this post

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-12-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-09
      • 1970-01-01
      • 1970-01-01
      • 2012-01-09
      • 1970-01-01
      相关资源
      最近更新 更多