StartViewFinderBitmapsL() on Success Calls the Function void ViewFinderFrameReady(CFbsBitmap &aFrame);. In this Function you would have to implement you draw code.
The Best way is to make your container Inherit McameraObserver. It has the following methods which are called in succession in that order
//call iCamera->Reserve in ConstructL() void ReserveComplete(TInt aError); //Power On Camera Here
void PowerOnComplete(TInt aError); //StartViewFinderBitmapsL comes here
void ViewFinderFrameReady(CFbsBitmap &aFrame); // Draw Comes here
void ImageReady(CFbsBitmap *aBitmap, HBufC8 *aData, TInt aError); //Once Clicked Pic data Comes here
void FrameBufferReady(MFrameBuffer *aFrameBuffer, TInt aError); //Required in Case of Video capture Ignore it
CCamera::TFormat format = CCamera::EFormatMonochrome; //Check For Support Image Format if(info.iImageFormatsSupported && CCamera::EFormatExif) { format = CCamera::EFormatExif; iCamera->SetJpegQuality(100); } else { iCameraObserver->CameraError(_L("Camera : Image Format Not Supported")); } iCamera->PrepareImageCaptureL(format,mode); //Check For Flash Support if(info.iFlashModesSupported && CCamera::EFlashAuto) { iCamera->SetFlashL(CCamera::EFlashAuto); }
TCameraInfo aCameraInfo; iCamera->CameraInfo(aCameraInfo); TSize aSize; TInt cc = aCameraInfo.iNumImageSizesSupported; for( TInt i=0; i<cc; i++ ) { iCamera->EnumerateCaptureSizes(aSize, i, CCamera::EFormatExif); // capture final high-quality (640 x 480) bitmap if(aSize.iWidth == 640) { iCamera->StartViewFinderBitmapsL(aSize); break; } } }
Forum posts: 96
StartViewFinderBitmapsL() on Success Calls the Function void ViewFinderFrameReady(CFbsBitmap &aFrame);. In this Function you would have to implement you draw code.
The Best way is to make your container Inherit McameraObserver. It has the following methods which are called in succession in that order
//call iCamera->Reserve in ConstructL()
void ReserveComplete(TInt aError); //Power On Camera Here
void PowerOnComplete(TInt aError); //StartViewFinderBitmapsL comes here
void ViewFinderFrameReady(CFbsBitmap &aFrame); // Draw Comes here
void ImageReady(CFbsBitmap *aBitmap, HBufC8 *aData, TInt aError); //Once Clicked Pic data Comes here
void FrameBufferReady(MFrameBuffer *aFrameBuffer, TInt aError); //Required in Case of Video capture Ignore it
Shashi Kiran G M
Forum posts: 96
The Code that Should Come in PowerOnComplete() is as follows
if(aError == KErrNone)
{
TCameraInfo info;
iCamera->CameraInfo(info);
TInt mode = info.iNumImageSizesSupported-1;
CCamera::TFormat format = CCamera::EFormatMonochrome;
//Check For Support Image Format
if(info.iImageFormatsSupported && CCamera::EFormatExif)
{
format = CCamera::EFormatExif;
iCamera->SetJpegQuality(100);
}
else
{
iCameraObserver->CameraError(_L("Camera : Image Format Not Supported"));
}
iCamera->PrepareImageCaptureL(format,mode);
//Check For Flash Support
if(info.iFlashModesSupported && CCamera::EFlashAuto)
{
iCamera->SetFlashL(CCamera::EFlashAuto);
}
TCameraInfo aCameraInfo;
iCamera->CameraInfo(aCameraInfo);
TSize aSize;
TInt cc = aCameraInfo.iNumImageSizesSupported;
for( TInt i=0; i<cc; i++ )
{
iCamera->EnumerateCaptureSizes(aSize, i, CCamera::EFormatExif);
// capture final high-quality (640 x 480) bitmap
if(aSize.iWidth == 640)
{
iCamera->StartViewFinderBitmapsL(aSize);
break;
}
}
}
Shashi Kiran G M