Adding bitmaps to your application (Part I): Creating a MBM file
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:
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.






> Adding bitmaps to your application (Part I): Creating a MBM fi
Hi.
What are the possible values for the color depth parameter?
Regards, Vitor Fernandes
> Re:Adding bitmaps to your application (Part I): Creating a MBM
I guess you can use c4, c8, c12 and probably c16 or c24. But I never tried these.
c8 is a safe and conservative choice since most (phone) devices have at least 256 colors.
> Re:Adding bitmaps to your application (Part I): Creating a MBM
> Adding bitmaps to your application (Part I): Creating a MBM fi
hi,
i wanted to load the mbm file (as created above) into the programm and wanted to add the icons to listbox ?
> Adding bitmaps to your application (Part I): Creating a MBM fi
Hello,Very Nice Article!!!
where the next???
> Adding bitmaps to your application (Part I): Creating a MBM fi
hi
i am still very new to Symbian OS C++. can you guide me through the way to upload a image on to the emulator and also the .cpp files that are needed.
i am using CodeWarrior v2.5, i seriously do not understand much.
Thanks a lot.
Regards
Ranmaru
another way to create mbm&mbg file
> Adding bitmaps to your application (Part I): Creating a MBM fi
Hello.
Nice article.
I have a question. I created an application that uses an MBM file. In the pkg i added the mbm file that is installed in the same directory with the application. It works fine for my Nokia 6600 but a friend from France can't use it. After installation, he runs the application and it closes immediately (i display a picture from the mbm file at startup).
Are there any security restrictions for file installations? Vodafone maybe?
Can i merge the mbm file in the rsc of the application?
Thank you, Lucian
> Adding bitmaps to your application (Part I): Creating a MBM fi
Have you handled the possibility to install to mmc card also? If not, applicataion would work perfectly while installed on phone memory, but if on mmc, bitmap cannot be read from correct place and normally you would program Leave on that case. This might be why it's working with some phones (that have installed on phone) and failing on some (that have installed on mmc)
Harri
> Adding bitmaps to your application (Part I): Creating a MBM fi
Thanks a lot for the article. It helped a lot!...
I have a comment on Symbian tools. I was just shocked to know that files generated by the compilation process end up in the epoc32\include directory. That's the main SDK include directory.
I hate that the compilation for Symbian leaves files all over the place but, in the main include directory? Wacko!!!....
My two cents...