我在android相機的Intent方法捕獲的imageview中顯示圖像。我已經通過三星Nexus測試了這個代碼,但是當我通過Nexus S進行測試時,圖像在270度時被旋轉了一圈。我一直在經歷這些鏈接如何在android中獲取設備的方向?
ACTION_IMAGE_CAPTURE orientation problem on Nexus S and Samsung Galaxy S I9000
Camera/picture orientation in Android
http://developer.android.com/reference/android/hardware/Camera.Parameters.html#setRotation%28int%29
Picture orientation from gallery/camera intent
但這個代碼
ExifInterface exif = new ExifInterface("filepath");
exif.getAttributeInt(ExifInterface.TAG_ORIENTATION, ExifInterface.ORIENTATION_NORMAL);
總是給0在兩個設備中。請告訴我我會知道,圖像顯示在特定設備中的哪個角度顯示,以便它將應用於所有設備,一旦我將獲得它的角度,我將自行旋轉。提前致謝。
或該[http://mobisocial.stanford.edu/news/2011/08/rotating-images-in-android/](http://mobisocial.stanford.edu/news/2011/08/rotating- images-in-android /) – sschrass
這是我對這個問題的解決方案; http://stackoverflow.com/a/8864367/137404 –