Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Contributor
tsjhon
Posts: 7
Registered: ‎06-20-2013
My Device: Developer

Camera rotation

Hello!

 

if the Orientation value in the bar-descriptor is set to Auto-orient, how can i set the orientation of the camera to Portrait? It doesn't have to rotate.

 

thanks in advance

Retired
PBernhardt
Posts: 749
Registered: ‎12-16-2008
My Device: BlackBerry Z30

Re: Camera rotation

You can lock the orientation while the screen with your viewnder is open. You can also manually rotate images after they are captured. Why do you want only portrait photos?

Paul Bernhardt
Application Development Consultant
BlackBerry
@PBernhardt

Did this answer your question? Please accept this post as the solution.
Found a bug? Report it to the Developer Issue Tracker
New Contributor
tsjhon
Posts: 7
Registered: ‎06-20-2013
My Device: Developer

Re: Camera rotation

Thanks for your response


PBernhardt wrote:

You can lock the orientation while the screen with your viewnder is open.


How can i do that? In the example of the api reference ( http://developer.blackberry.com/cascades/reference/bb__cascades__multimedia__barcodedetector.html ), i tried

...
onCameraOpened: {
    camera.startViewfinder();
    OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.Portrait;
}
...

but it didn't work.

PBernhardt wrote:

Why do you want only portrait photos?


It's for barcodes. It has to be in portrait because at work they want the camera in this orientation.

Developer
slashkyle
Posts: 820
Registered: ‎10-16-2012
My Device: Red Z10

Re: Camera rotation

if you don't mind nothing rotating automatically, you can set orientation to portrait in the bar descriptor under the Application tab

New Contributor
tsjhon
Posts: 7
Registered: ‎06-20-2013
My Device: Developer

Re: Camera rotation


slashkyle wrote:

if you don't mind nothing rotating automatically, you can set orientation to portrait in the bar descriptor under the Application tab


It is not possible because another classes of the application have to rotate.
New Contributor
tsjhon
Posts: 7
Registered: ‎06-20-2013
My Device: Developer

Re: Camera rotation

[ Edited ]

Finally i did the following:

 

...

onCameraOpened: {

   ...

   camera.startViewfinder()
}

onViewfinderStarted: {
    OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.Portrait;
}

onViewfinderStopped: {
    OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.Portrait;
}

...