DataNewL problems with CImageDecoder

Login to reply to this topic.
Thu, 2005-06-16 23:23
Joined: 2003-12-30
Forum posts: 93
Hello

I need some clarification concerning the handling of DataNewL with the ImageDecoder. I wrote this function :

void CJpegView::LoadFromDesc(TDesC8& aSourceData)
{
   __ASSERT_ALWAYS(!IsActive(),User::Invariant());
   // create a CImageDecoder to read a desc
   delete iLoadUtil;
   iLoadUtil = NULL;
   
   _LIT8(MimeType,"image/jpeg");
   iLoadUtil = CImageDecoder::DataNewL(iFs, aSourceData, MimeType,    CImageDecoder::EOptionNone);
   
   TInt aSelectedFrame = 0;
   // store the frame information and frame count
   iFrameInfo = iLoadUtil->FrameInfo(aSelectedFrame);
   iFrameCount = iLoadUtil->FrameCount();


   // resize the destination bitmap to fit the required size
   TRect bitmapSize = iFrameInfo.iFrameCoordsInPixels;
   iBitmap.Resize(bitmapSize.Size());
   // start reading the bitmap: RunL called when complete
   iLoadUtil->Convert(&iStatus, iBitmap, aSelectedFrame);
   SetActive();
}


What I really can't understand is why I'm getting a broken picture display ( picture partially displayed) when using JPEGs ( size greater than 10 kb). The data coming from aSourceData is correct ( tested with the deprecated CMdaImageFileDesctoBitmapUtility ).
Other thing : changing the line : iBitmap.Resize(bitmapSize.Size()) will result to display nothing... could someone explain me why ?

Thx a lot !
MatD:-)

MatD

  • Login to reply to this topic.