×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Mar 2004
    Posts
    6

    What's wrong with my program?

    _LIT(KImageFile,"c:\\System\\Apps\\image.png");

    RFs fs;
    RFile resImageFile;//the resImageFile contains many images
    TUint8* imageBuf = NULL;
    CMdaImageDescToBitmapUtility* iImageConverter £½ NULL;
    TInt imageSize = 20000;//image size

    fs.Connect();
    //Open resImage file
    resImageFile.Open(fs,KImageFile,EFileShareExclusive|EFileRead);

    iImageConverter = CMdaImageDescToBitmapUtility::NewL(*this);

    imageBuf = (TUint8*) User::Alloc(imageSize *sizeof(TUint8));
    TPtrC8 buffer(imageBuf, imageSize);

    //Read image data
    resImageFile.Read(buffer, imageSize);

    //??????????????????????????????
    iImageConverter->OpenL(buffer);//Why open error?
    //??????????????????????????????

    TBuf8<20000> iBuf;
    iBuf = buffer;
    //??????????????????????????????
    iImageConverter->OpenL(iBuf);//Open successful,why?
    //??????????????????????????????

    delete imageBuf;
    imageBuf = NULL;
    delete ImageConverter;
    ImageConverter = NULL;
    fs.Close();

  2. #2
    Regular Contributor
    Join Date
    Feb 2004
    Posts
    51
    What be useful to get a bit more information.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×