×

Discussion Board

Results 1 to 2 of 2
  1. #1
    Registered User
    Join Date
    Aug 2005
    Posts
    28

    Post Loading 2 Images Loading Problem

    Hi, I want to load two PNG images and store them in CFbsBitmap and display them in an overlapping manner(one on top of another). However... When I try to blit them... Only one image is shown... Can anybody help me please? Here's my code... Thanks!


    //This is from my CCipherConter.Cpp file
    void CCipherContainer::ConstructL(const TRect& aRect)
    {
    iMenuCode=0;
    iCurrentScreen=EMainScreen;
    CreateWindowL();

    SetRect(aRect);
    ActivateL();

    iConverter = CMdaImageFileToBitmapUtility::NewL(*this);
    //Start an asynchronous process to open the PNG file
    iConverter->OpenL(KMainPngFileName);
    iConverter->OpenL(KRedButtonPngFileName); //This to be displayed on top of KMainPngFileName
    }


    void CCipherContainer::LoadMainMenuL()
    {

    CWindowGc& gc = SystemGc();
    gc.Activate(*DrawableWindow());
    gc.Clear(Rect());


    if (iConvertState==EConvertStateReady)
    {
    gc.BitBlt(Rect().iTl,iBitmap);
    }


    gc.Deactivate();

    }



    //THESE ARE THE CALLBACK FUNTIONS
    void CCipherContainer::MiuoOpenComplete(TInt aError)
    {
    if (aError == KErrNone)
    {
    iConvertState = EConvertStateConvertingFromPng;

    TFrameInfo frameInfo;
    //Get the frame info
    iConverter->FrameInfo(KPngFrameIndex,frameInfo);


    iBitmap = new (ELeave) CFbsBitmap();

    //Create a bitmap based on the size of the PNG
    TInt err = iBitmap->Create(frameInfo.iOverallSizeInPixels,KDeviceColourDepth);
    if (err == KErrCouldNotConnect)
    {
    //NEikonEnvironment::MessageBox(_L("Could not connect to font and bitmap server"));
    return;
    }
    if (err == KErrArgument)
    {
    //NEikonEnvironment::MessageBox(_L("Illegal Gif file size"));
    return;
    }

    //Convert the gif into a bitmap
    TRAPD(convertErr,iConverter->ConvertL(*iBitmap,KPngFrameIndex)); //*iBitmap

    //Trap error as this function cannot leave
    if (convertErr != KErrNone)
    {
    //NEikonEnvironment::MessageBox(_L("Cannot initiate converter"));
    }

    }

    else if (aError == KErrUnderflow)
    {
    //This error occurs if the gif file contains insufficient information
    //This is usually because the file is being opened in a cache so a futher attempt to open
    //should be performed
    TRAPD(err,iConverter->OpenL(KMainPngFileName));
    if (err !=KErrNone)
    {
    //NEikonEnvironment::MessageBox(_L("Gif file contains insufficient information, cannot retry"));
    }
    }

    else
    {
    //NEikonEnvironment::MessageBox(_L("Error opening file"));
    }

    }

    void CCipherContainer::MiuoConvertComplete(TInt aError)
    {

    if( aError != KErrNone )
    {
    iErrorCode = aError;
    return;
    }

    //What's next?
    iConvertState=EConvertStateReady;
    MenuLoaderL();
    //DrawNow();
    }

    void CCipherContainer::MiuoCreateComplete(TInt aError)
    {
    }




    Somebody help me please... Thanks...

  2. #2
    Regular Contributor
    Join Date
    Oct 2004
    Location
    india
    Posts
    306

    Re: Loading 2 Images Loading Problem

    OpenConverterl() calls asynchrounous process miuoopencomplete miuoconvertcomplte...so u call openconverterl() second time only after completion of first openconverterl().....

Similar Threads

  1. Problem with images in TABs
    By larsoveclaesson in forum Symbian User Interface
    Replies: 0
    Last Post: 2005-07-19, 19:15
  2. Error Loading Images java.io.IOException
    By sushant_125 in forum Mobile Java General
    Replies: 1
    Last Post: 2005-01-05, 09:53
  3. problem to send a service loading message push for 8310
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 12:39
  4. Problem to send a service loading push message for 8310
    By alinesimon in forum General Messaging
    Replies: 1
    Last Post: 2002-05-06, 11:19

Posting Permissions

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