Note that there are some explanatory texts on larger screens.

plurals
  1. POportrait camera orientation on galaxy tab
    text
    copied!<p>I am developing on/for a Samsung Galaxy Tab (7inches). My application has to be in portrait mode only, i.e i have locked it to portrait mode in my application and in the device settings. The problem is when i try to rotate the camera preview, it is currently rotated 90 degrees in the wrong direction.</p> <p>Right now this is my surfaceCreated</p> <pre><code> public void surfaceCreated(SurfaceHolder holder) { camera = Camera.open(); try { camera.setPreviewDisplay(holder); Camera.Parameters parameters = camera.getParameters(); parameters.setPictureFormat(PixelFormat.JPEG); parameters.set("orientation", "portrait"); //camera.setDisplayOrientation(90); parameters.setRotation(90); camera.setParameters(parameters); } catch (IOException exception) { camera.release(); } } </code></pre> <p>The camera.setDisplayOrientation(90) does not seem to be working (it does nothing, which is why i have commented it away). However the parameters.setRotation(90) DOES IN FACT GET THE JOB DONE! but it creates an ugly "stripe" of "flickering colors" along the side of the application. setDisplayOrientation() should work for me, since i am running android api 8 (Froyo 2.2)!!</p> <p>There is a thread on google about problems pertaining to rotational issues <a href="http://code.google.com/p/android/issues/detail?id=1193#c26" rel="nofollow">http://code.google.com/p/android/issues/detail?id=1193#c26</a>, but to the best of my knowledge it does not suggest anything for my problem.</p> <p>Any and all solutions pertaining to this problem will be greatly appreciated! thanks!</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload