This page was last modified 03:44, 14 May 2008.
Transparent Icon in S60
From Forum Nokia Wiki
Here is a way of how to load and display transparent icons in S60 3rd Edition .
The following steps is followed if the project is in Carbide C++
To display a transparent icon, firstly you can have Bitmap image file.
Second step is to make a monochrome image of the already created BMP file. This is quite easy, open the image in paint brush or any photo editor. Save the image as Type : Monochrome Bitmap
Copy both the images, the original BMP file and its Monochrome type to the 'gfx' folder of your project
Take the (Projectname).mmp file. Right click the file in Carbide. There will be an option "Add MBM entry". Select It.
In Target File Path : Press the Default button. The project path will be automatically added to the Target File path
Select the Header option
Now press the "Add from project " button. The two images (original and mask ) will be displayed.
Select the original image first
After that select the mask image
You may also add images from your filesystem
Now select both the selected images , "Pair Image and Mask " button will be highlighted, select it.
If no thumb preview is shown , then select the combined image, After that select the mask depth properties and set it to '1'. Now the preview of the icon will be displayed.
Contents |
Code
Now comes the developing part
Header file
ImageDisplay.h
#include <eikimage.h> _LIT(KIconName, "\\resource\\apps\\ImageDisplay.mbm"); private: void CreatImage(); /** *From CoeControl */ virtual TInt CountComponentControls() const; /** *From CoeControl */ virtual CCoeControl *ComponentControl(TInt aIndex) const; private: CEikImage* iImgCtrl; CFbsBitmap* iImg; CFbsBitmap* iImgM;
Source file
ImageDisplay.cpp
#include <akniconutils.h> #include <ImageDisplay.mbg> void CImageDisplayAppView::CreatImage() { iImgCtrl = new (ELeave) CEikImage; iImgCtrl->SetContainerWindowL(*this); AknIconUtils::CreateIconL( iImg, iImgM, KIconName, EMbmImagedisplayBack, EMbmImagedisplayBack_mask ); AknIconUtils::SetSize( iImg, TSize(13, 13) ); iImgCtrl->SetPicture(iImg, iImgM); iImgCtrl->SetExtent(TPoint(20,20),TSize(13, 13)); } TInt CImageDisplayAppView::CountComponentControls() const { return 1; } CCoeControl* CImageDisplayAppView::ComponentControl(TInt aIndex) const { switch(aIndex) { case 0: return iImgCtrl; break; default: return NULL; } }
MMP file
The following capabilities and libraries are required:
CAPABILITY NONE LIBRARY fbscli.lib LIBRARY aknicon.lib
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Collision Detection when using drawPixels() | dannyroy_77 | Mobile Java Media (Graphics & Sounds) | 20 | 2003-08-27 12:06 |
| MIDlet icon in active standby | simsiem | Mobile Java General | 5 | 2007-06-18 21:00 |
| how to create a label with semi-transparent background? | falafala | Symbian User Interface | 5 | 2008-03-25 10:45 |
| Icon in CAknColumnListBox (3rd Ed. FP1) | ronald29 | Symbian User Interface | 12 | 2007-04-26 08:05 |
| VS2005 + Carbide.vs 3.0.1 debug problem | fairhood | Symbian Tools & SDKs | 4 | 2008-02-21 03:09 |


