Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Image Orientation in ActionSnap

Image Orientation in ActionSnap

billynyh 2011-10-24

Oursky Limited

October 24, 2011
Tweet

More Decks by Oursky Limited

Other Decks in Programming

Transcript

  1. Camera Support API 7 • Fixed app orientation • No

    orientation related method, must call camera in landscape mode
  2. OrientationEventListener • Helper class for receiving notifications from the SensorManager

    when the orientation of the device has changed. • call onOrientationChanged(int) when the device orientation changes. • return degree 0-359 • (deg >= 225 && deg <= 315) considered as portrait photo
  3. Display http://developer.android.com/reference/android/view/Display.html • Provides information about the display size and

    density. • getOrientation() - API 7 (deprecated) • getRotation() - API 8 • Returns the rotation of the screen from its "natural" orientation. • For example, if a device has a naturally tall screen, and the user has turned it on its side to go into a landscape orientation, the value returned here may be either Surface. ROTATION_90 or Surface.ROTATION_270 depending on the direction it was turned.
  4. Combine sensor and display orientation (in landscape mode) if displayOrientation

    == 0 // device with landscape orientation - Galaxy Tab 10.1 (deg >= 45 && deg <= 135) considered as portrait photo else // normal phone (deg >= 225 && deg <= 315) considered as portrait photo
  5. Front camera preview display of front-facing cameras is flipped horizontally

    before the rotation. Landscape image - no problem Portrait image - ?
  6. Front camera of Galaxy Tab 7 • android 2.2 •

    no front camera API • no information about number of cameras • current solution: hard code device model • done?