|
||
Bitmaps can be stored in multi-bitmap (.mbm
) files,
which can be built from .bmp
files as part of the
abld
process. Loading them has four stages:
Put the name of the bitmap file into a buffer.
Create a bitmap (CFbsBitmap
).
Load the bitmap using CFbsBitmap::Load()
.
If an error is returned, leave and ensure the bitmap is cleaned up
// set the name of the multi-bitmap file containing the bitmaps
_LIT(KMBMFileName,"z:\\resource\\apps\\grbmap2.mbm");
// load the bitmap from an .mbm file
CFbsBitmap* bitmap = new (ELeave) CFbsBitmap();
CleanupStack::PushL(bitmap);
User::LeaveIfError(bitmap->Load(KMBMFileName, EMbmGrbmap2Smiley));
// EMbmGrbmap2Smiley is the ID of a bitmap in the .mbm file
...
// clean up
CleanupStack::PopAndDestroy();