diff -r 51a74ef9ed63 -r ae94777fff8f Symbian3/SDK/Source/GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita --- a/Symbian3/SDK/Source/GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita Wed Mar 31 11:11:55 2010 +0100 +++ b/Symbian3/SDK/Source/GUID-A1D2C673-3B91-403A-800B-5E1504FB19EE.dita Fri Jun 11 12:39:03 2010 +0100 @@ -1,124 +1,130 @@ - - - - - -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.

-The steps required to capture a still image - -

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.

    -
      -
    • Create a camera object using the CCamera::New2L() method.

    • -
    • Reserve the camera for your application using the CCamera::Reserve() method. MCameraObserver2::HandleEvent is called upon -completion.

    • -
    • Switch on the camera power using the CCamera::PowerOn() method. MCameraObserver2::HandleEvent is called upon -completion.

    • -
    • If needed, share the camera between multiple clients using -the CCamera::NewDuplicate2L() function. This function -needs the handle of an existing camera object (use CCamera::Handle()).

    • -
    -
  2. -
  3. Configure -the camera settings.

    -
      -
    • Before you adjust the settings, make sure the camera hardware -supports the particular option. Use CCamera::CameraInfo() to retrieve and TCameraInfo to -specify the camera information.

      For example, to find out what -image formats are supported by the onboard camera, use the TCameraInfo::iImageFormatsSupported member variable.

    • -
    • Specify the image format using the CCamera::PrepareImageCaptureL method. For a list of -possible formats, see CCamera::TFormat.

      Devices support image capture in EXIF JPEG format (CCamera::EFormatExif), which is encoded with -JPEG and requires no additional conversion.

    • -
    • Specify the desired image size using the CCamera::EnumerateCaptureSizes() method.

      -
    • -
    • Additionally, you can set, for example, the brightness, contrast, -zoom level, flash mode, exposure and white balance of the image. For more -information on the options, see the CCamera::CCameraAdvancedSettings class. You can also use the settings directly under CCamera.

      -
    • -
    -
      -
    • 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.

    • -
    -
  4. -
  5. Use the display -of the device as a viewfinder by transferring image data from the camera to -the display memory.

    -
      -
    • Start the transfer of viewfinder data with direct screen -access using the CCamera::StartViewFinderDirectL() method.

      -
    • -
    • Transfer viewfinder data as a bitmap using the CCamera::StartViewFinderBitmapsL() method. - MCameraObserver2::ViewFinderReady is called -upon completion.

    • -
    • Set viewfinder mirroring on and flip the image horizontally -using the CCamera::SetViewFinderMirrorL() method.

      -
    • -
    • Stop the transfer of viewfinder data to the screen using -the CCamera::StopViewFinder() method.

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

  8. -
  9. 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.

  10. -
  11. 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> -
  12. -
  13. Make sure -you have correct capabilities information -set for your application. You need at least the UserEnvironment capability.

    -
  14. -
  15. 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.

  16. -
-
-
See also -

Capturing Image

-

Controlling Pre-Image -Capture

-

Controlling Captured -Image

-

Controlling Still-image -Capture

-

Using Time Nudge -Capture Drive Mode

-

Background Processing -for Ecam

-
+ + + + + +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.

+The steps required to capture a still image +

Important implementation considerations include:

+
    +
  • 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. +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> +
  • +
  • Make sure you have correct capabilities information +set for your application. You need at least the UserEnvironment capability.

    +
  • +
  • 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.

  • +
+
To capture still +images on a mobile device +
    +
  1. Initialize +the onboard camera.

    +
      +
    • Create a camera object using the CCamera::New2L() method.

      +
    • +
    • Reserve the camera for your application using the CCamera::Reserve() method. MCameraObserver2::HandleEvent is called upon completion.

    • +
    • Switch on the camera power using the CCamera::PowerOn() method. MCameraObserver2::HandleEvent is +called upon completion.

    • +
    • If needed, share the camera between multiple clients using +the CCamera::NewDuplicate2L() function. This function needs +the handle of an existing camera object (use CCamera::Handle()).

      +
    • +
    +
  2. +
  3. Configure +the camera settings.

    +
      +
    • Before you adjust the settings, make sure the camera hardware +supports the particular option. Use CCamera::CameraInfo() to +retrieve and TCameraInfo to specify the camera information.

      +

      For example, to find out what image formats are supported by the onboard +camera, use the TCameraInfo::iImageFormatsSupported member +variable.

    • +
    • Specify the image format using the CCamera::PrepareImageCaptureL method. +For a list of possible formats, see CCamera::TFormat.

      +

      Devices support image capture in EXIF JPEG format (CCamera::EFormatExif), +which is encoded with JPEG and requires no additional conversion.

    • +
    • Specify the desired image size using the CCamera::EnumerateCaptureSizes() method.

      +
    • +
    • Additionally, you can set, for example, the brightness, contrast, +zoom level, flash mode, exposure and white balance of the image. For more +information on the options, see the CCamera::CCameraAdvancedSettings class. +You can also use the settings directly under CCamera.

      +
    • +
    +
      +
    • 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.

    • +
    +
  4. +
  5. Use the display +of the device as a viewfinder by transferring image data from the camera to +the display memory.

    +
      +
    • Start the transfer of viewfinder data with direct screen +access using the CCamera::StartViewFinderDirectL() method.

      +
    • +
    • Transfer viewfinder data as a bitmap using the CCamera::StartViewFinderBitmapsL() method. + MCameraObserver2::ViewFinderReady is called upon completion.

      +
    • +
    • Set viewfinder mirroring on and flip the image horizontally +using the CCamera::SetViewFinderMirrorL() method.

      +
    • +
    • Stop the transfer of viewfinder data to the screen using +the CCamera::StopViewFinder() method.

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

  8. +
  9. 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.

    +
  10. +
+
+
Additional information +on capturing still images +

For reference examples, see:

+
    +
  • Camera +Example: Capturing and controlling the images using Camera

  • +
  • Introduction to the Camera API on the Symbian Foundation

    +
  • +
  • S60 Platform: Camera Example on Forum Nokia.

  • +
+

For information on how to capture an image using Time-Nudge-Capture +drive mode, see Using +Time Nudge Capture Drive Mode .

+

For information on how to capture an image using standalone background +processing, see Background +Processing for Ecam.

+

For information on displaying images on the screen, see Image +Display Library Overview

+
\ No newline at end of file