Namespaces

Variants
Actions

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 over the next few weeks. Thanks for all your past and future contributions.

How to Display an Image in Navigation Pane Using Resources

From Wiki
Jump to: navigation, search
Article Metadata
Article
Created: vasant21 (14 May 2007)
Last edited: hamishwillee (18 Sep 2012)

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 :

#include <avkon.mbg>
 
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.


TUid naviPaneUid;
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
TResourceReader reader;
 
 
iCoeEnv->CreateResourceReaderLC(reader, R_YOURAPPLICATION_NAVI_IMAGE);
 
if (iNaviDecorator)
{
 
delete iNaviDecorator;
iNaviDecorator = NULL;
 
}
 
// set the navigation pane image
iNaviDecorator = naviPane->CreateNavigationImageL(reader);
// pushed by CreateResourceReaderLC
CleanupStack::PopAndDestroy();
naviPane->PushL(*iNaviDecorator);
}
This page was last modified on 18 September 2012, at 05:58.
53 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×