Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries. Thanks for all your past and future contributions.
How to Display an Image in Navigation Pane Using Resources
We can specify an image for the navigation pane in the resource file using the NAVI_IMAGE resource. This resource has three fields:
- bmpfile - Specifies a .mbm file to use.
- bmpid - Specifies an index of the bitmap to use within the .mbm file.
- bmpmask - Optionally specifies an index of the mask to use within the .mbm file.
The following is the code snippet for .rss file :
RESOURCE NAVI_IMAGE r_yourapplication_navi_image
bmpfile = "\\system\data\avkon.mbm"; // or KAvkonBitmapFile define in avkon.rh
bmpid = EMbmAvkonQgn_stat_keyguard;
The bmpfile field specifies the .mbm file's location, and the specific bitmap to use from the file is specified by the bmpid field.
naviPaneUid.iUid = EEikStatusPaneUidNavi;
CEikStatusPane* statusPane = StatusPane();
CEikStatusPaneBase::TPaneCapabilities subPane = statusPane->PaneCapabilities(naviPaneUid);
// if we can access the navigation pane
if (subPane.IsPresent() && subPane.IsAppOwned())
CAknNavigationControlContainer* naviPane = (CAknNavigationControlContainer*)statusPane->ControlL(naviPaneUid);
// read the navigation pane image resource
iNaviDecorator = NULL;
// set the navigation pane image
iNaviDecorator = naviPane->CreateNavigationImageL(reader);
// pushed by CreateResourceReaderLC