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 Developer
arjunhemrajani
Posts: 20
Registered: ‎07-14-2012
My Device: Dev Alpha , Curev 9300

how to use camerasettings api

applySettings(CameraSettings *camera);

 

I cant get it can anyone help please!

How do i pass the object and what should the object contain and where should i invoke this function in the qml or cpp

Regular Contributor
Megha_9_dec
Posts: 56
Registered: ‎08-21-2012
My Device: BB10

Re: how to use camerasettings api

Hi Arjun,

 

There're two ways: using QML 

 

Camera {
id: camera1
preferredWidth: 1280
preferredHeight: 768
}

// A CameraSettings object to store the flash mode.
attachedObjects: [
CameraSettings {
id: cam_settings
}
]

 

 

Using Cpp: 


Camera *camera = root->findChild<Camera*>("myCamera");
camera->open(CameraUnit::Rear);
CameraSettings* cameraSettings = new CameraSettings();
cameraSettings->setCameraMode(CameraMode::smileytongue:hoto);
 cameraSettings->setFlashMode(CameraFlashMode::Light);
cameraSettings->setCaptureResolution(QSize(768, 1280));
camera->applySettings(cameraSettings);