This short tutorial will explain how a Symbian application can access and display bitmaps. There is several ways to do it but we will only deal with the simplest one:
create some standard BMP files
construct a MBM file. MBM stands for Multi-BitMaps and is Symbian specific file format to hold bitmaps. A single MBM file can contain several bitmaps with different resolution and/or color-depth.
open it in the application
The MBM file is constructed as a part of the compilation process. So you have do declare an entry for it in the application’s MMP file. The syntax for this is:
start bitmap target-file
[targetpath target-path ]
[header ]
[sourcepath source-path ]
source color-depth source-bitmap-list
end
target-file is the name of the file to generate with its MBM extension (e.g. sprites.mbm).
The targetpath primitive is optional. If it is specified, target-path is the location where the MBM file will be stored.
If it is not specified, the application directory will be used.
If the header keyword is supplied, a .mbg header file will be generated in directory epoc32\include (e.g. sprites.mbg).
This is sometimes useful since it automatically creates token IDs to adress each invidual bitmaps within the MBM.
sourcepath indicates the location of your original BMP files.
The source statement is used to specify the list of BMP files to write into the MBM.
All the bitmaps within the statement shall have the same color-depth.
The format for his specifier is [c]bit-depth where bit-depth is the number of bits per pixel and c indicates a color bitmap.
If you want to include files with different color-depth in a single MBM, you have to add several source statement.
If you want to include files located in several directories in a single MBM, you need to add several sourcepath... source statements.
Example:
start bitmap sprites.mbm
header
sourcepath ..\bitmaps
source c8 ship.bmp bullet.bmp alien1.bmp alien2.bmp
end
If you need to create several MBM files, you need to use a start bitmap ... end declaration for each of your file.
|