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
Highlighted
Contributor
Posts: 43
Registered: ‎01-05-2013
My Device: Dev Alpha
My Carrier: Telenor Hungary

Camera Flash as a torch

Hi,

 

I want to use the device's camera as a torch. I've read the Camera API documentation, and found the necessary libs and methods to do this. I'm using this snippet:

 

Camera *camera = appPage->findChild<Camera*>("camera");

camera->open(CameraUnit::Rear);

CameraSettings *settings = new CameraSettings();
camera->getSettings(settings);
settings->setFlashMode(bb::cascades::multimedia::CameraFlashMode::Light);
camera->applySettings(settings);

 

But the Flash is not lighting... Any ideas?

 

Thx,

br,

chriske

--------------------------------------------------------------
If my post was helpful or it was the solution for Your problem, please don't forget to give me a like, and mark my post as a solution. Thanks!
Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: Camera Flash as a torch

[ Edited ]

If you have DevAlpha A , it has known bug with camera flash, and it is not working on it. It will not be fixed, and your code is probably working. 

 

Look at this post http://supportforums.blackberry.com/t5/Native-Development/Camera-flash-on-BB10-Dev-Alpha-hangs/m-p/2...