Discussion Board

Results 1 to 4 of 4
  1. #1
    Regular Contributor
    Join Date
    Nov 2006

    how to show image on a menu click?

    hi 2 all,

    i want to show an image on menu click from my app.
    so for showing image i referred sdk help code .......like this.
    for this firstly i created a mbm file by adding following code snippet in mmp...

    START BITMAP myapp.mbm
    SOURCEPATH ..\bitmaps
    SOURCE C12 myappimage.bmp
    SOURCE C12 myappimage_mask.bmp


    i have one fn in my container named ShowImageL().....which calls another fn in same container class LoadImageL() having implementation like below

    iMyImage = LoadMyBitmapL();


    TFileName mbmFileName(KMBMFileName);
    // load the bitmap from the mbm file
    CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
    // EMbmMygameImage1 is enumerated value from myapp.mbg file

    CleanupStack::Pop(); // bitmap
    return bitmap;

    and then in draw fn i added this line.....

    gc.DrawBitmap(aRect,iMyImage );

    and then from my appui's handlecommandL fn i called


    after doing all this stuff i made sis file and tested on device ....but when i clicked on this menu option which shows image ...it does nothing.
    i mean it dosent shows image....

    can anyone has displayed an image on menu click?...or does anyone from forum knows how to display image?.......

    any help in this regard is highly appriciated.


  2. #2
    Regular Contributor
    Join Date
    Feb 2007

    Re: how to show image on a menu click?


    y don't u use the code given below for u image to display i think this will slear u much

    code is:

    CFbsBitmap* iImageBitmap = new (ELeave) CFbsBitmap;
    CleanupStack::PushL( iImageBitmap);
    _LIT( KMBMFile , "Z:\\system\\apps\\Bmprelese\\Bmprelese.mbm" );
    iImageBitmap->Load(KMBMFile, 4);

    than tell me.

  3. #3
    Regular Contributor
    Join Date
    Nov 2006

    Re: how to show image on a menu click?

    hi gills,

    thanks for ur reply.

    yah i used the code snippet given by you....but when i installed the sis on device and clicked on menu option to show the image then it suddenly closes my app.

    am trying hard to show the required image but till not succeed.....
    i used the enum name instead of the id posted by you.


  4. #4
    Regular Contributor
    Join Date
    Nov 2006

    Re: how to show image on a menu click?

    hi 2 all,

    can anyone tell me how to show image?........
    actually i m also tried to use the code as given below...but till my app closes when i called this showimageL function.
    TFileName ImgFilename;
    //TInt ID = EMbmmyappimage;//
    iMyImage = NBitmapMethods::CreateBitmapL(ImgFilename,ID);
    and then in draw fn....

    gc.BitBlt( TPoint(10, 10), iMyImage);

    after installing sis and when i called showimageL from my appui my app suddenly closes....

    can anyone tell me where i m doing wrong?....
    plz help.

    awaiting for your valuable reply.....


Similar Threads

  1. --- ???save image problem??? ---
    By ferenn in forum Mobile Java Media (Graphics & Sounds)
    Replies: 6
    Last Post: 2007-10-01, 14:33
  2. Opening a JPEG Image
    By ummarbhutta in forum Mobile Java Media (Graphics & Sounds)
    Replies: 8
    Last Post: 2007-02-15, 06:34
  3. slide menu in j2me
    By afka in forum Mobile Java General
    Replies: 4
    Last Post: 2006-09-04, 09:10
  4. show more than 1 image
    By sunny_singh in forum Symbian
    Replies: 2
    Last Post: 2005-11-04, 12:32
  5. Nokia Image Converter
    By davidpurdie in forum General Development Questions
    Replies: 0
    Last Post: 2004-02-18, 15:31

Posting Permissions

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