The MBM file format
25 Mar 2003 - 13:16
Keywords :
OffsetFieldNameValueComment
0000Epoc Id3700 0010 KDirectFileStoreLayoutUidValue
0004Mbm Id4200 0010KMultiBitmapFileImageUid
0008Constant0000 0000UID3, which is not needed in this case
000CChecksum3964 3947Checksum of the 3 UID's; Constant for all MBM's
0010TrailerOffsetxxxx xxxxOffset of Trailer in the file

  Bitmap Header and Pixels Data repeats for each bitmap within the MBM:
 
Bitmap Header

OffsetFieldNameValueComment
Header offsetLengthxxxx xxxxIncludes these bytes and pixels data
Header+0004Header length2800 0000Always 0x28
Header+0008X-Sizexxxx xxxxWidth of image in pixels
Header+000CY-Sizexxxx xxxxHeight of image in pixels
Header+0010Twips-Xxxxx xxxxWidth of image in twips, i.e. 1/1440 inch.
These can be zero if X-Size and Y-Size are provided
Header+0014Twips-Yxxxx xxxxHeight of image in twips
Header+0018Bits Per Pixelxx00 00000x08 for a 256 colors bitmap
Header+001CImageIsColorxx00 00000x00:No,
0x01:Yes,
Header+0020PaletteSizexxxx xxxx 
Header+0024Compressionxx00 00000x00:No,
0x01:8BitRLE,
0x02:12BitRLE,
0x03:16BitRLE,
0x04:24BitRLE

Pixels data
-  Not RLE compressed lines are rounded to 8 byte boundery
-  RLE (??? UNCOMPLETE)


Trailer

OffsetFieldNameValueComment
Trailer+0000Number Of Bitmapsxxxx xxxxNumber of pictures in the mbm file
Trailer+0004Header Offset for first bitmap1400 0000Always 0x0014
Trailer+0008Header Offset for 2nd bitmapxxxx xxxxIf present...
............
The content of this article comes from the two following pages:
-  Frodo's Homepage
-  Rudy König's Homepage
Tutorial posted March 25th, 2003 by eric

Submitted by Michal Sankot (not verified) on Thu, 2004-11-04 11:21.

12 bit RLE compression looks like following:

1 RLE packet: [GGGGBBBB] [nnnnRRRR]

nnnn: n+1 is number of repetitions
RGB: are 4bit values of Red,Green,Blue

In my case I needed to create image with 8bits per color per pixel, so the conversion is

R = (R << 4) | R
G = (G << 4) | G
B = (B << 4 )| B



copyright 2003-2009 NewLC SARL