Using Time-Nudge-Capture Drive Mode

This topic describes how to capture an image using Time-Nudge-Capture drive mode in the Ecam API.

Before you start you should understand the following topics:

The EDriveModeTimeNudgeCapture mode allows you to specify the amount of images to be captured both before and after the capture button key press. The numbers of pre- or post-capture images to be captured are set by the TDriveModeDependentAttributes values, with the total number of images being calculated as follows:

Total number of captured images = iParam1 + 1 + iParam2 where iParam1 and iParam2 represent pre and post capture images respectively, and 1 represents the present image.


  1. Call CCamera::New2L(MCameraObserver2 &,TInt,TInt) to create an instance of CCamera.

  2. Call CCamera::CCameraPreImageCaptureControl to create an image capture object.

  3. Call CCamera::PrepareImageCapture(const TPrepareImageParameter&, MCaptureImageObserver&) to prepare for capturing the image. TPrepareImageParameter uses TDriveModeDependentAttributes to set the number of images before and after the camera capture key press event. The iDriveMode value in TPrepareImageParameter should be replaced into the EDriveModeTimeNudgeCapture value, to support the time-nudge-capture drive mode. If an aErrorCode occurs while preparing an image, you have to call CCamera::PrepareImageComplete(CCamera::CCameraImageCapture*, TInt). Note: The PrepareImageComplete() callback is deferred until the implementation is ready with the pre-image data saved in the buffer so that you can press the capture key at any time. Meanwhile the implementation continues saving the latest pre-capture images until the CaptureImage() function is called.

  4. Call CCamera::CaptureImage(CCameraCapture*) to capture an image. Note: You can call the CaptureImage() function to capture the current image exposed to the sensor plus the required number of post-image capture images.

  5. Call the MCaptureImageObserver::IndividualImageControlHandle(CCamera::CCameraImageCapture&, TPostCaptureControlId) function for each captured image to pass the individual id of each image to the client.

  6. Call MCaptureImageObserver::ImageCaptureComplete(CCamera::CCameraImageCapture&, TInt) and [a11]CCamera::HandleEvent(KUidECamEventReadyForNextCapture) to notify the client that the current capture operation has finished. Note: This must only occur once the implementation has saved another set of pre-image capture images. This is so that the implementation is ready to receive further CaptureImage() calls.

  7. Call CCamera::CCameraPostImageCaptureControl(TUid, TPostCaptureControlUid) to control the post image capture after capturing the desired image.

  8. Call the CCamera::HandleEvent(KUidECamEventReadyForNextPrepare) function when you have deleted the current CCameraImageCapture object. Note: In this drive mode, only one instance of CCameraImageCapture can be created at any one time, i.e. PrepareImageCapture() can only be called once. In order to successfully call PrepareImageCapture() again and create a new CCameraImageCapture object, clients must first destroy the previous one. Therefore, the implementation should only issue this callback once the client has deleted the object.