×

Discussion Board

Results 1 to 3 of 3

Thread: Draw Image

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    28

    Draw Image

    Hi All,

    is anyone can tell me is there any wrongs at my draw image code below?
    i got problem when i call draw ( use DrawNow() ), the image successfully draw but not for long time the screen became white again even image is still contained at memory.

    Code:
    void CTestMain::Draw( const TRect& aRect ) const
    {
        CWindowGc& gc = SystemGc();
        gc.Clear( aRect );
        
        if (iBolDraw)
        {
        CFbsBitmap* bitmap = new CFbsBitmap;
        RFs fs;
        User::LeaveIfError(fs.Connect());
            
        CImageDecoder* decoder = CImageDecoder::DataNewL(fs, *iBuf); //iBuf = HBufc8*
        TFrameInfo frameInfo = decoder->FrameInfo(0);
        bitmap->Create(frameInfo.iOverallSizeInPixels, frameInfo.iFrameDisplayMode);
            
        TRequestStatus status = KRequestPending;
        decoder->Convert(&status, *bitmap);
            
        gc.BitBlt(TPoint(0,0), bitmap);
            
        fs.Close();
        }
    }
    THX,
    Best Regards,
    Jun

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,169

    Re: Draw Image

    You should never even contruct the image in a draw function, thus please move all image construction parts into your containers ConstructL function. The draw function is alled multiple times while your application is executing, thus you are leaking rather big amount of memory there.

    Also do implement a Active object for the image decoder, basically you are never waiting it to finish, thus I would be suprised to see any image there.

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    28

    Re: Draw Image

    Hi yucca,

    Thx for your quick reply. i will try to do as U said.


    THX,
    Best Regards,
    Jun

Similar Threads

  1. How to draw image over the background image
    By amit04.kumar in forum Symbian Media (Closed)
    Replies: 5
    Last Post: 2010-09-15, 16:15
  2. How can i draw a image?
    By GFYsweetwood in forum Symbian Media (Closed)
    Replies: 2
    Last Post: 2008-11-25, 09:37
  3. How can I blit/draw a specific region of an Image to another Image?
    By tongits in forum Mobile Java Tools & SDKs
    Replies: 1
    Last Post: 2006-04-29, 08:52
  4. Draw an Image on itself
    By FatalError in forum Mobile Java Media (Graphics & Sounds)
    Replies: 4
    Last Post: 2004-05-15, 11:08
  5. how to draw image ...
    By sridhar_ratna in forum Symbian
    Replies: 1
    Last Post: 2003-03-28, 14:48

Posting Permissions

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