You Are Here:

Community: Wiki

This page was last modified on 4 June 2009, at 07:28.

How to Display an Image in Navigation Pane Using Resources

From Forum Nokia Wiki

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);
}

Related Wiki Articles

No related wiki articles found

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia