Hi,

I have figured out a way to do this. You have to set the parameter key
called "orientation" to the value "portrait" using the set() method of
CameraParameters class.
Snippet:

Parameters params = mCamera.getParameters();
params.set("orientation", "portrait");
mCamera.setParameters(params);

This can be done in the surfaceCreated() method before calling
startPreview().
This works great for me :)

Regards,
Anirudh

On Sep 30, 4:10 pm, Fin <f_mac...@hotmail.com> wrote:
> Hi All,
>
> I have acamerapreview in a portion of the main screen of my app.  I
> want it to work in both lanscape andportraitmode.  Is there any way
> to get a preview working inportraitmode which doesnt rotate the
> image 90 degrees?
>
> The only successful method I have tried so far is forcing the app into
> landscape mode but then I have the problem that all my other widgets
> on screen are rotated too.
>
> I also have seen some references to thecameraor preview properties
> and a rotate proprty.  I have tried this and didnt get an error but
> equally didn't get a correctly rotated preview.
>
> Has anyone  managed to get this to work?
>
> Regards,
>
> Fin
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to