diff -r 000000000000 -r 89d6a7a84779 Symbian3/SDK/Source/GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-4-1-5-1.dita --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Symbian3/SDK/Source/GUID-55BF8452-F9FF-5CF3-9D74-3BC7F5447551-GENID-1-6-1-17-1-1-4-1-5-1.dita Thu Jan 21 18:18:20 2010 +0000 @@ -0,0 +1,82 @@ + + + + + +CameraExample: +Capturing and controlling the images using Camera +
Description

This +example is a GUI application and has the standard classes required by any +application using UI controls such as an application, a document, an application +UI and a view. It provides UI controls such as power on, power off, viewfinder +required to capture and control the images.

Note: To run the +example, you must have a plug-in that supports the Camera implementation. +Symbian does not provide any such implementation.

The example demonstrates +the following key features:

    +
  • Control settings

  • +
  • Basic settings

  • +
  • Advanced settings

  • +

Control settings

This +example demonstrates the following Camera control settings:

    +
  • Reserve: Calls +the asynchronous CCamera::Reserve() function to initialise +and reserve the camera for exclusive use. Calls the MCameraObserver::ReserveComplete() when +initialisation is complete.

  • +
  • Power on: Calls +asynchronous the CCameraAppUi::PowerOn() function to switch +on the power of the camera. You must have successfully called the CCamera::Reserve() prior +to calling this function. Calls the MCameraObserver::PowerOnComplete() when +power on is complete.

  • +
  • Viewfinder: Calls +the CCameraAppUi::StartViewFinderL() function to transfer +the viewfinder data to the given portion of the screen using Direct Screen +Access. To stop the transfer of the data, the CCameraAppUi::StopViewFinder() function +is called.

  • +
  • Capture image: Gets +the image size for the index passed by calling the CCamera::EnumerateCaptureSizes() function. +The image details such as image format and the size index are passed to the CCamera::PrepareImageCaptureL() function +to allocate the memory for the image to be captured. Then, a call to the CCamera::CaptureImage() captures +the image.

  • +
  • Capture Video: Gets +the video frame size and video frame rate for the index passed by calling +the CCamera::EnumerateVideoFrameSizes() function and the CCamera::EnumerateVideoFrameRates() functions +respectively. The video details such as frame sizes and frame rate index are +passed to the CCamera::PrepareVideoCaptureL () function +to allocate the memory for the video to be captured. Then, a call to the CCamera::StartVideoCapture() starts +capturing the video and a call to the CCamera::StopVideoCapture() stops +capturing the video.

  • +
  • Power off: Calls +the CCameraAppUi::PowerOff() function to synchronously +switch off the camera power.

  • +

Basic settings

For +controlling the brightness and the contrast of the device, calls to the CCamera::Brightness() and +the CCamera::Contrast() functions are made. Increment and +decrement factors are separately passed to the CCamera::SetBrightnessL() and +the CCamera::SetContrastL() functions to increase and decrease +the brightness and contrast respectively. Similarly, you can control other +features like flash and exposure time of the device.

Advanced +settings

Advanced settings, such as, capturing a snapshot and +presets need to have the corresponding settings object created. This can be +done by calling the corresponding advanced setting class's NewL() function +passing in the CCamera object to it. For example, to create +a snapshot object, call the CCamera::CCameraSnapshot::NewL(*camera) function. +Use this CCamera object to call any of the functions such +as the CCameraAdvancedSettings::SupportedBracketModes(), +the CCameraSnapshot::StartSnapshot(), the CCameraDirectViewFinder::ResumeViewFinderDirectL() and +the CCameraHistogram::PrepareHistogramL() to set the advanced +features.

+
Download

Click on the following link to download +the example: CameraExample.zip file

Click: browse to view the example code.

+
Class summary

CCamera CCameraAdvancedSettings CCameraDirectViewFinder CCameraSnapshot CCameraHistogram CCameraOverlay CCameraImageProcessing CCameraPresets MCameraObserver2

+
Build

The Symbian build process describes +how to build an application.

The CameraExample builds an executable +called cameraexample.exe in the standard location (\epoc32\release\winscw\ <build_variant> for +CodeWarrior). Either launch the executable itself, or launch the emulator +and then select the icon CameraExample from the Emulator's extras bar.

+
\ No newline at end of file