Capturing still images

To capture still images or to use the display as a viewfinder, build your application around the Symbian Ecam camera utility. To make use of the device camera to capture an image, the application needs to repeat the steps described in the illustration below.

Figure 1. The steps required to capture a still image
Note:

The settings you can use in your application depend on what the camera hardware on the device supports.

To capture images, use the methods of the CCamera and MCameraObserver2 classes to construct your application. MCameraObserver2 uses the advanced camera features of the CCamera::CCameraAdvancedSettings class.

For reference examples, see:

To capture still images on a mobile device

  1. Initialize the onboard camera.

  2. Configure the camera settings.

    • Before you can call CCamera::CaptureImage(), allocate memory and set up image format, size and clipping rectangle using the CCamera::PrepareImageCaptureL() method. This needs to be called only once for multiple captures.

  3. Use the display of the device as a viewfinder by transferring image data from the camera to the display memory.

  4. Capture one or multiple images using the CCamera::CaptureImage() method. MCameraObserver2::ImageBufferReady() is called upon completion.

  5. To exit the application or to switch it to the background, switch off the camera power using the CCamera::PowerOff() method and release the camera for other applications using the CCamera::Release() method.

  6. The CCamera and MCameraObserver2 classes are defined in the ecam.h header file. Add the following line to the .h file, which is used to deploy the API:

    #include <ecam.h>
  7. Make sure you have correct capabilities information set for your application. You need at least the UserEnvironment capability.

  8. Make sure ecam.lib is accessible to your linker when compiling your application by including it in your mmp file or by editing the project properties in your IDE, depending on your build environment.