如何在 Android 1.6 上获取图像的当前旋转?

发布于 2024-10-14 04:33:25 字数 960 浏览 1 评论 0原文

如何在 Android 1.6 上获取图像的当前旋转? 至于android 2.0我使用ExifInterface,但它在android 1.6上不可用我想在android 1.6上实现这样的功能

ExifInterface exif = new ExifInterface(path);
             int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
             if (orientation != -1) {
                     // recognize a subset of orientation tag values.
                     switch (orientation) {
                     case ExifInterface.ORIENTATION_ROTATE_90:
                         degree = 90;
                         break;
                     case ExifInterface.ORIENTATION_ROTATE_180:
                         degree = 180;
                         break;
                     case ExifInterface.ORIENTATION_ROTATE_270:
                         degree = 270;
                         break;
                     default:
                         degree = 0;
                         break;
                     }
                 }

How could I get current rotation of image on Android 1.6?
As for android 2.0 I use ExifInterface , but it isn't available at android 1.6 I want realize smth like this on android 1.6

ExifInterface exif = new ExifInterface(path);
             int orientation = exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, 1);
             if (orientation != -1) {
                     // recognize a subset of orientation tag values.
                     switch (orientation) {
                     case ExifInterface.ORIENTATION_ROTATE_90:
                         degree = 90;
                         break;
                     case ExifInterface.ORIENTATION_ROTATE_180:
                         degree = 180;
                         break;
                     case ExifInterface.ORIENTATION_ROTATE_270:
                         degree = 270;
                         break;
                     default:
                         degree = 0;
                         break;
                     }
                 }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文