StartViewFinderBitmapsL

Login to reply to this topic.
Mon, 2008-06-16 11:05
Joined: 2008-04-15
Forum posts: 7

Can somebody tell the implimentation of StartViewFinderBitmapsL ? May be some code snippets


Tue, 2008-07-01 05:41
Joined: 2007-01-17
Forum posts: 96
Re: StartViewFinderBitmapsL

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

Tue, 2008-07-01 05:45
Joined: 2007-01-17
Forum posts: 96
Re: StartViewFinderBitmapsL

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

  • Login to reply to this topic.