首 页 | 新 闻 | Symbian | Android| Windows Mobile | J2ME | 下载中心 | 游戏策划招聘与求职 | 购书指南 | 视频教程
您现在的位置: 开发视界 >> Symbian英文资料 >> Graphics >> 文章正文
Adding bitmaps to your application (Part I): Creating a MBM file
作者:佚名    文章来源:不详    更新时间:2006-5-7 11:13:58

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.

相关文章:
How to reset the alternate makmake entry in Codewarrior
Carbide.vs - Disabling the MMP/PKG File update feature
Codewarrior: how to avoid the "Too Many Include Paths" error when using the UIQ 2.1 SDK
Carbide.c++: Setting up On Target Debugging
Display the extended panic code in Emulator or Device
Start automatically an application or an exe after its installation
Compress Your Symbian C++ Executables
How To Freeze New Exports From Dll
 

站点地图 | 加入收藏 | 联系站长 | 广告服务 |
QQ:280529124  Tel:0592-8271361 辽ICP备05021703号