camera_set_zoom()

Configure the zoom level on the camera.

Synopsis:

#include <camera/camera_api.h>
 
camera_error_t camera_set_zoom(camera_handle_t handle,                 
                               unsigned int level,                 
                               bool smooth)

Since:

BlackBerry 10.0.0

Arguments:

handle

The handle returned by a call to the camera_open() function.

level

An unsigned int value which falls within the range returned by camera_get_zoom_limits() function. A value of 0 indicates not to use zoom. Values larger than 0 indicate increasing magnification.

smooth

A of true specifies to smoothly transition to the specified level value, while a value of false, specifies to jump to the specified zoom level.

Library:

libcamapi (For the qcc command, use the -l camapi option to link against this library)

Description:

Only call this function if the CAMERA_FEATURE_VIDEOZOOM or CAMERA_FEATURE_PHOTOZOOM features are available. You can determine whether these feature are available by calling the camera_can_feature() function. The viewfinder must be running before using this function.

The value that you specify as the level argument sets the viewfinder zoom-level. The zoom level is a value supported by the camera hardware and can represent an optical or digital zoom depending on which the hardware supports.

You can specify whether to use smooth zooming using the smooth argument. You can use the camera_get_zoom_limits() function to determine the supported zoom levels and whether the camera supports smooth zooming.

Note: Changing the zoom level can interfere with existing settings, which depend on coordinates within the viewfinder frame. For example, the camera_set_focus_regions() function can exhibit undefined behavior after the zoom level has changed. To resolve this issue, ensure that you reapply any region-dependent settings after a zoom level change.

The zoom level is reset to default when the viewfinder is stopped.

Returns:

CAMERA_EOK when the function successfully sets the zoom level, otherwise another camera_error_t value that provides the reason that the call failed.