×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Apr 2004
    Posts
    19

    How to convert PNG to bitmap???

    I'am trying to convert a PNG to a bitmap but it crashes everytime I open the apps???
    I don't know what wrong?

    Here is my code:

    void CPNGContainer::ConstructL(const TRect& /*aRect*/)
    {
    CreateWindowL();
    SetExtentToWholeScreen();
    ActivateL();

    iImageBits = new (ELeave) CFbsBitmap();
    iConverter = CMdaImageFileToBitmapUtility::NewL(*this);
    iConverter->OpenL(KPicFileName);
    }

    void CPNGContainer::Draw(const TRect& /*aRect*/) const
    {
    CWindowGc& gc = SystemGc();
    gc.Clear(Rect());
    gc.BitBlt(Rect().iTl,iImageBits);
    }

    void CPNGContainer::MiuoOpenComplete(TInt /*aError*/)
    {
    TFrameInfo frameInfo;
    iConverter->FrameInfo(0, frameInfo);
    err = iImageBits->Create(frameInfo.iOverallSizeInPixels,EColor4K);
    TRAPD(convertErr,iConverter->ConvertL(*iImageBits));
    }

    void CPNGContainer::MiuoConvertComplete(TInt aError)
    {
    delete iImageBits;
    iImageBits = NULL;
    }

    void CPNGContainer::MiuoCreateComplete(TInt aError)
    { /* no implementation */ }

    Please Help!!! I just can't figure out what wrong with this.... I've been trying to figure out this for a whole day now and I'm just getting frustrated... : (

    Any help will do! if you could also explain it....

  2. #2
    Super Contributor
    Join Date
    Apr 2003
    Location
    Czech Republic
    Posts
    915
    where exactly it crashes? Have you tried to debug it? What is in KPicFileName?

  3. #3
    Registered User
    Join Date
    Apr 2004
    Posts
    19
    Never mind I already figured it out, it's in draw that was having problem!

    Thanks any ways!!!

Posting Permissions

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