×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    211

    Question Showing Image in Listbox

    I want to show an image inside the listbox(anywhere).
    Also I don't want to show that as an icon in the listbox items.

    my code will be like this...
    Wheneever an item is clicked in the listbox, i am doing this..

    case EEventItemClicked:
    {
    iJPG_Reader = new (ELeave)CImageReader(*this);
    _LIT(kfilepath,"C:\\data\\Images\\Sunset.bmp");
    iJPG_Reader->ConstructL(kfilepath);
    iSrcbitmap=iJPG_Reader->Bitmap();
    }
    break;
    This will change my bmp file into mbm format.
    My draw() will be like this,
    void CContactsManagerAppView:raw(const TRect& /*aRect*/) const
    {
    // Get the standard graphics context
    CWindowGc& gc = SystemGc();

    // Gets the control's extent
    TRect drawRect(Rect());

    // Clears the screen
    gc.Clear(drawRect);
    if(iSrcbitmap)
    {
    gc.BitBlt(TPoint(300,300),iSrcbitmap);
    //gc.DrawLine(TPoint(50,200),TPoint(100,200));
    }
    }
    But it is not drawing inside the listbox.

  2. #2
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: Showing Image in Listbox

    Hi,

    If you want the image to be drawn inside the listbox wihout providing it with an icon, you can try drawing it inside CListItemDrawer:rawActualItem.

  3. #3
    Regular Contributor
    Join Date
    Jul 2009
    Posts
    211

    Re: Showing Image in Listbox

    I am having my mbm image format in iSrcbitmap.

    There is no parameter in that method to give my CFbsBitmap* iSrcbitmap;
    Last edited by siva_321; 2009-11-02 at 07:20.

  4. #4
    Registered User
    Join Date
    Jun 2007
    Location
    Mumbai, India
    Posts
    1,998

    Re: Showing Image in Listbox

    Quote Originally Posted by siva_321 View Post
    There is no parameter in that method to give my CFbsBitmap* iSrcbitmap;
    So does Draw(const TRect& /*aRect*/) const function take parameter as CFbsBitmap* iSrcbitmap, so as to draw a bitmap on screen. DrawActualItem is also somewhat similar to your Draw function.

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. I want to put image in listbox on Right hand side
    By babjan saheb in forum Symbian User Interface
    Replies: 1
    Last Post: 2009-03-30, 14:51
  3. listbox for showing database entries?
    By paloskar in forum Symbian User Interface
    Replies: 2
    Last Post: 2004-08-16, 19:28
  4. S60 showing image at startup
    By mrcap in forum Mobile Java Media (Graphics & Sounds)
    Replies: 2
    Last Post: 2003-10-01, 07:26
  5. Items not showing in listbox
    By hanhikos in forum Symbian
    Replies: 4
    Last Post: 2003-07-07, 09:47

Posting Permissions

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