×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    How to draw image over the background image

    Hello All,
    I am developing GUI based application in which there is a background image for application and for icon (i.e. also image). I have set the background image.

    Know, I am trying to set the icon image on container by carbide GUI designer but it looks like below image.

    img1.PNG

    I have also tried the URL
    http://discussion.forum.nokia.com/fo...er-image/page2

    but on the below line in draw function
    gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
    Gives error it said :: multiple marker at this line

    Please suggest.

    Thanks,
    Amit

  2. #2
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: How to draw image over the background image

    Quote Originally Posted by amit04.kumar View Post
    gc.BitBltMasked(TPoint, iBitmap, TRect, iMask, EFalse);
    Gives error it said :: multiple marker at this line

    Please suggest.

    Thanks,
    Amit
    You cannot pass TPoint and TRect as such. You need to pass the respective variables of them.

    Anyways you are posting a link from your local host, please upload your image here via Manage attachment.
    Nokia Developer Wiki Moderation team

  3. #3
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    Re: How to draw image over the background image

    Hi Kiran,

    Thanks once again after a very long time.

    Sorry for posting the image via local host. I was just edited my post but during the updating time I received your reply. please see the below attachment

    img1.PNG


    Thanks,
    Amit

  4. #4
    Nokia Developer Champion
    Join Date
    Mar 2006
    Location
    Helsinki, Finland
    Posts
    8,345

    Re: How to draw image over the background image

    1) What if you just draw that icon on the container, not with the background image? Does it draw it correctly?
    2) How are you drawing that icon image? Show your code.
    Nokia Developer Wiki Moderation team

  5. #5
    Regular Contributor
    Join Date
    Sep 2009
    Location
    India
    Posts
    172

    Re: How to draw image over the background image

    Kiran,

    After your reply I have changed Draw function code with
    gc.BitBltMasked(TPoint(5,10), iBitmap, aRect, iMask, EFalse);
    application runs but didn't get icon image on container. But background image distorted. After that I have try to draw the image without the background image but its not draw.

    My code:
    void CDemoContainer::InitializeControlsL()
    {
    iImage1 = new ( ELeave ) CEikImage;
    {
    //CFbsBitmap *bitmap, *mask;
    AknIconUtils::CreateIconL( iBitmap, iMask,
    Kdemo1File, EMbmDemo1Cell, EMbmDemo1Cell2 );
    AknIconUtils::SetSize( iBitmap, TSize( 73, 75 ), EAspectRatioPreserved );
    AknIconUtils::SetSize( iMask, TSize( 73, 75 ), EAspectRatioPreserved );

    //iImage1->SetPicture( iBitmap, iMask );
    }
    //iImage1->SetAlignment( EHCenterVTop );

    }

    void CDemoContainer:raw( const TRect& aRect ) const
    {
    // [[[ begin generated region: do not modify [Generated Contents]
    CWindowGc& gc = SystemGc();
    gc.Clear( aRect );

    // ]]] end generated region [Generated Contents]

    CFbsBitmap* iBitmap = new (ELeave) CFbsBitmap;
    TInt retval = iBitmap->Load(KMBMFile);
    gc.BitBlt(Rect().iTl, iBitmap);
    gc.BitBltMasked(TPoint(5,10), iBitmap, aRect, iMask, EFalse);


    }
    Below is distorted background image but no icon
    img2.PNG

    Thanks,
    Amit

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,697

    Re: How to draw image over the background image

    aRect has nothing to do with your image, it says which part of the control has to be redrawn. Most basic applications simply ignore it.
    You should rather pass the size of your bitmap, the TSize(73,75) which you are using, or you can also ask it from the bitmap itself (iBitmap->SizeInPixels())

Similar Threads

  1. How to draw background image or change color of default listbox
    By sumanthgwn in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-08-24, 14:03
  2. Replies: 47
    Last Post: 2009-07-21, 11:08
  3. problem in display an image button on canvas(Background image)
    By mramin05 in forum Mobile Java Media (Graphics & Sounds)
    Replies: 3
    Last Post: 2008-11-12, 04:51
  4. [moved] How to draw image on the background of the listbox
    By amitjigupta in forum Symbian User Interface
    Replies: 2
    Last Post: 2008-08-09, 10:38
  5. 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

Posting Permissions

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