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

Java Development

Reply
Developer
angelo_f
Posts: 64
Registered: ‎05-06-2009
My Device: Not Specified

Re: Storm/Torch camera getSnapshot() orientation issue

Actually I just got it to work. I was trying to do the rotation after I had captured but before saving the file, thinking I needed to rotate before saving the file. However, the rotation is stored in the actual file when I captured the screenshot. So i read the file, get the metadata and do a rotation. Displays the correct way for me now
Please use plain text.
Developer
behrk2
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Storm/Torch camera getSnapshot() orientation issue

Nice catch!  I was doing the same thing as you (trying to rotate the raw bytes).  Once I saved the image first, it started rotating correctly.  I have a couple more issues:

 

First, are you converting the image back into a byte[] array after you rotate it as a bitmap?  I need to do this, and unfortunately I don't see any way with the RIM API.

 

Second, have you had issues rotating the device while the camera is open?  When I do this, the screen goes white.  If I rotate the device BEFORE opening the camera, it will show the camera view, except as a smaller window (as opposed to full screen).

 

Third, are you using two different sets of camera code (one for 5.0 and one for 6.0)?  I'm finding that I am going to have to do this, mostly because the code for the camera demo on 5.0 which determines camera encodings does not seem to work on the 6.0 devices...

 

Thanks.

Please use plain text.
Developer
angelo_f
Posts: 64
Registered: ‎05-06-2009
My Device: Not Specified

Re: Storm/Torch camera getSnapshot() orientation issue

No I don't, I also dont display my images while camera is open, however, it is not relevant to what I am doing. I do my rotation and add it to a BitmapField and display it then. If you want the camera view full screen then st the camera view full screen. This is what I dio _video = (VideoControl)_player.getControl("VideoControl"); _cameraView = (Field)_video.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, "net.rim.device.api.ui.Field"); _video.setDisplayFullScreen(true); I am just using V5. That is bad news about the encodings, however, you should be able to detect the encodings avialable in runtime
Please use plain text.
Developer
behrk2
Posts: 367
Registered: ‎11-25-2009
My Device: Not Specified

Re: Storm/Torch camera getSnapshot() orientation issue

Thanks for your help.

 

Just as an FYI, I was able to get the encodings working on all devices by using the code from the camerademo provided in the 6.0 SDK.  I had to remove any lines of code that weren't in the 5.0 API, but it is nothing essential (mostly just menu items, focus control, etc.)

Please use plain text.