Pictures are held in internal files named |bm0, |bm1 and so on.
Windows 3.0 files name them without the bar. The same layout is used by the standalone
hotspot (.shg) and multi-resolution (.mrb) picture files that help
authors kept beside their projects.
Picture file
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | u16 | Magic | 0x506C (lP) or 0x706C (lp) |
| 2 | 2 | u16 | NumberOfPictures | Usually 1; more in an MRB, one for each screen resolution |
| 4 | 4 each | u32 | PictureOffset | From the start of this file, one for each picture |
Picture
A picture starts with its type and packing. Sizes and offsets inside it are compressed integers unless shown otherwise. The offsets are from the start of this picture.
| Name | Type | Description |
|---|---|---|
PictureType | u8 | 5 device-dependent bitmap, 6 device-independent bitmap, 8 Windows metafile |
PackingMethod | u8 | 0 none, 1 run-length, 2 LZ77, 3 LZ77 then run-length |
Bitmaps (types 5 and 6)
| Name | Type | Description |
|---|---|---|
Xdpi, Ydpi | culong | Resolution, in dots per inch |
Planes, BitCount | cushort | Colour planes and bits per pixel |
Width, Height | culong | Size in pixels |
ColorsUsed, ColorsImportant | culong | Palette size (or 0 for the full size); important colours of 1 marks a transparent bitmap |
CompressedSize, HotspotSize | culong | Bytes of packed pixels, and of hotspot data |
CompressedOffset, HotspotOffset | u32 | Where the pixels and the hotspots are |
| palette | 4 bytes each | Type 6 only: blue, green, red and an unused byte for each colour |
Type 6 pixels are a Windows device-independent bitmap, rows from the bottom up, each row padded to 32 bits. Type 5 pixels are a device-dependent bitmap, rows from the top down, each padded to 16 bits.
Metafiles (type 8)
| Name | Type | Description |
|---|---|---|
MappingMode | cushort | The Windows mapping mode |
Width, Height | u16 | Size in the metafile’s units |
DecompressedSize | culong | Size of the unpacked metafile |
CompressedSize, HotspotSize | culong | Bytes of packed metafile and of hotspot data |
CompressedOffset, HotspotOffset | u32 | Where they are |
Hotspots
A picture can have clickable areas. The hotspot data starts with a byte that is always
1, a u16 count, and a u32 macro data size. Then come 15-byte
records, one per hotspot: three kind bytes (what a click does), u16 X, Y,
width and height, and a u32 hash or macro number. After them come the macro
data, then each hotspot’s name and target as NUL-terminated strings.