hi,
i was able to create .mbm file using bmconv.exe tool from cmd prompt
but i'm not getting how to load individual icon from that file
thanks in advance.
hi,
i was able to create .mbm file using bmconv.exe tool from cmd prompt
but i'm not getting how to load individual icon from that file
thanks in advance.
CFbsBitmap::Load
If you have multiple images in .mbm file than you need to remember index of image to access it.
For example if create .mbm file with images
bmconv My.mbm /c24list_icon.bmp list_icon_mask.bmp /c24list_icon1.bmp list_icon1_mask.bmp
Then you can access first image as
CFbsBitmap* pBitmap = new (ELeave) CFbsBitmap();
pBitmap->Load(My.mbm,0); //for first image
second one as
CFbsBitmap* pBitmap1 = new (ELeave) CFbsBitmap();
pBitmap1->Load(My.mbm,1); //for second image
Search CFbsBitmap in the Wiki: For e.g: Setting the image and mask bitmaps
Use /h switch as /hMy.mbg and it will generate corresponding header (.mbg) file with enumerations. Include it in your application and you don't need to remember indexes. :)
Nokia Developer Wiki Moderation team
hey savaj, thank u
i want the image to act as a button.
for this do i have to set the image on any button, like CEikCommandButton
or is there any function that makes the image act as a button?
Last edited by tlr; 2009-04-10 at 12:36.
Which class you are using for button??? AFAIK you can not draw image on button created by CEikTextButton, because CEikTextButton has no image associated with it, it displays a label only. you can change color of it.
If you want to draw image on button control than u can refer this article.
http://wiki.forum.nokia.com/index.php/Custom_button
hey, i dont want that type of button
the image itself should act as a button
i don't know how does BitmapButton look like, but still i'm trying it in this way
EMbmIconsDollar was generated in .mbg file, and -1 is the default maskCode:LIT(KFileName, "z:\\resource\\apps\\icons.mbm"); iBitmapButton = new (ELeave) CEikBitmapButton; iBitmapButton->SetContainerWindowL(*this); iBitmapButton->SetPictureFromFileL(KFileName, EMbmIconsDollar, -1, CEikCommandButtonBase::EFirst);
my control stopped at the last line while debugging and it didn't display any image on emulator
where i'm wrong ?
friends its not working
somebody help me plzzz........
icons.mbm is there at specified location ??? Try to put them in private/application folder.
there can not be a private/application path, and usually you can not see what folders there are in the private folder.
Instead just use private/{your-app-uid}, where you replace the {your-app-uid} with your UID without the 0x prefix.