You Are Here:

Community: Wiki

This page was last modified on 5 August 2009, at 05:54.

如何利用资源文件在导航栏中显示图片

From Forum Nokia Wiki

  • 详细描述

我们可以使用NAVI_IMAGE资源描述来指定导航栏的图片。这个资源有三个字段需要定义:

bmpfile 指定一个mbm文件

bmpid 指定mbm文件中某个图片的index值

bmpmask 可选,用来指定mbm文件中某个遮罩文件的index值


下列代码片段是rss文件中定义的:

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

bmpfile字段指定了mbm文件的位置,然后可以使用指定具体图片的字段

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 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fwikiE2eforumE2enokiaE2ecomE2findeE78E2ephpE2fTalkE3aE4cargeE5fscreenE5fsaverX qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqfntypeZWikiContentQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qfnZtypeQUqfntypeZWikiContentQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqfntypeZWikiContentQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ