Icon creation panics if out of bounds
|ID||Unofficial - No ID assigned||Creation date||Nov 13, 2007|
|Platform||S60 3rd Edition MR||Devices||Emulator|
|Category||Symbian C++||Subcategory||AknIconUtils and AknsUtils classes|
When trying to create an icon with both
and given a .mif file which is indexed with an out-of-bound index to create an icon, a panic "AknIcon 5" appears.
This might also be the case with .mbm files.
should not panic if given an out-of-bounds index in a .mif file. Instead, they should return an error code (see below for correct behavior).
The documentation should also include a notice about the possible panic if this is not corrected to the S60 platform.
Do not use the methods
in your code if there is a danger of out-of-bounds graphic to appear in a .mif file. Instead use
CFbsBitmap* bitMapErr = new CFbsBitmap;
TInt err = bitMapErr->Load(FILENAME, IMG_ID);
to test of possible out-of-bounds conditions. The above returns correctly
KErrEof -25 End of file has been reached.
for an out-of-bounds index which can be handled by the developer.
Another option would be to add suitable accessors to test how many images there are inside a .mif file prior to invoking the icon creation functions.