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
Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified
Accepted Solution

Zoom In and Zoom out feature using camera_api.h

In my application i want to give user option to set Zoom in and Zoom out feature of the camera. I check that camera_set_zoom() method and camera_get_zoom_limits() may be helpful in this. Is there any sample available for this?

Super Contributor
Meghasanghvi
Posts: 306
Registered: ‎08-10-2010
My Device: Not Specified

Re: Zoom In and Zoom out feature using camera_api.h

I find the solution from the camera_api.h.There is methods in the camera_api.h by using that we can set the zoom level.

 

Code:

unsigned int min_level;
unsigned int max_level;
bool value = true;

camera_get_zoom_limits(mCameraHandle, &min_level, &max_level, &value);

camera_set_zoom(mCameraHandle, max_level, true);

 

Thanks,

Megha.

 

BlackBerry Development Advisor
smcveigh
Posts: 668
Registered: ‎11-29-2011
My Device: developer

Re: Zoom In and Zoom out feature using camera_api.h

don't use true for the smooth argument. camera_get_zoom_limits() should report that smooth zoom is not supported.

In any event, yes, you can call the camera_get_zoom_limits() function to determine the min and max supported zoom setting. You may apply any setting between those 2 values using camera_set_zoom().

Cheers,
Sean