Hi all,

I am new to Symbian programming. Right now I am trying to convert bitmap returned by ViewFinderFrameReady() into a desc and back to bitmap. I am now experiencing some problems in the image conversion.

I am trying to do encoding and decoding by using CImageEncode and CImageDecode functions.

As for CImageEncode, it seems that only a small fractions of the images streamed by the viewfinder are able to be encoded successfully (return KErrNone). I wonder why is that so ? My encoding function goes as follow:

void CBluetoothEngine::ViewFinderFrameReady(CFbsBitmap& aFrame)
{
iBitmap2 = &aFrame;
StartEncodeL();
}
void CBluetoothEngine::StartEncodeL(){
delete iBuffer;
iBuffer = NULL;
delete iEncoder;
iEncoder = NULL;

iStatus = KErrNone;
iEncoder = CImageEncoder:ataNewL(iBuffer,_L8("image/bmp"),CImageEncoder::EOptionAlwaysThread);
iState = EEncoding;
iEncoder->Convert(&iStatus, *iBitmap2);
SetActive();
}

As for my decoding function, it actually never goes beyond the call:
iDecoder = CImageDecoder:ataNewL(CCoeEnv::Static()->FsSession(),iBuffer->Des(),_L8("image/jpeg"),CImageDecoder::EOptionAlwaysThread);

In the debugging mode, it cannot go beyond this code. What could've gone wrong with this call ?

I declared the variables in my header file as follow:

private:
TRequestStatus iStatus;
HBufC8* iBuffer;
CImageDecoder* iDecoder;
CImageEncoder* iEncoder;

I'm really desperate for help and advice. Please do help me.
Thanks in advance!

William