Namespaces
Variants
Actions
Revision as of 06:39, 21 June 2012 by hamishwillee (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Archived:Loading app image files under the \private folder may fail (Known Issue)

Jump to: navigation, search
Archived.png
Archived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

Using AknIconUtils to load icons or graphics may fail on S60 3rd Edition if the image file is located under a protected folder.

Article Metadata

Compatibility
Platform(s): S60 3rd Edition

Article
Created: User:Technical writer 1 (16 Aug 2007)
Last edited: hamishwillee (21 Jun 2012)

Description

Trying to use the following method from AknIconUtils (akniconutils.h) will fail on S60 3rd Edition if the image file aFileName is in a protected folder, for example, under \private\appUID\:

void CreateIconL( CFbsBitmap *&aBitmap,
CFbsBitmap *&aMask,
const TDesC &aFileName,
TInt aBitmapId,
TInt aMaskId )

This happens because the Avkon icon server cannot access files located under protected folders.

How to reproduce

The AknIconUtils::CreateIconL() method does not leave in this situation; however, aBitmap and aMask parameters are not pointing to valid bitmaps. Any attempt to use the returned bitmaps will fail or cause a panic.

For example, trying to set the size of the bitmap with AknIconUtils::SetSize() will return error -46 (KErrPermissionDenied).

Solution

Instead of passing a filename to CAknIconUtils, applications should implement the mix-in class MAknIconFileProvider to provide an opened file handle that can be used by the Avkon icon server.

CAknIconUtils has overloaded variants of the CreateIconL() method that will accept a reference to the MAknIconFileProvider instance. For an example implementation of MAknIconFileProvider class, see S60 Platform: Scalable Screen-Drawing Example, available for download at http://www.developer.nokia.com/.

Note.png
Note: An .mbm or .mif file that contains application icons (and is referred to in the LOCALISABLE_APP_INFO resource definition) should always be installed under \resource\apps\.
217 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved