.BMP
OS/2 bitmap array (BA)
Introduction
A bitmap array is a chain of bitmaps in one file, each made for a different screen. OS/2’s Presentation Manager used it so that one picture, icon or mouse pointer could carry versions for low and high resolution displays, and the system could pick the one that fitted best. Each entry is a short array header followed by a complete bitmap, icon or pointer.
Most OS/2 icon and pointer files are bitmap arrays, so these files are found with the
extensions .ico and .ptr as well as .bmp.
Software
Structure
The file is a linked list. Each array header gives the offset of the next one, and is followed straight away by the file header and DIB header of its own image, the same parts a BM bitmap uses. A colour icon or pointer adds its second file header there too. The pixel data of every image is found through the offset in its file header, and is usually stored after all the headers. All numbers are little-endian.
0Array headerBA, size, offset of the next array header, display size14 bytes14File header of the first image, with its own type such asBM,ICorCI14 bytes28DIB header and colour table, then a second set for a colour icon or pointervaries
offNextArray header for the next screen, and so on untiloffNextis 014 bytes…Pixel data for each image, at the offset in its file headervaries
Array header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | char[2] | usType | The signature BA (42 41). |
| 2 | 4 | u32 | cbSize | The size of the header. |
| 6 | 4 | u32 | offNext | The offset from the start of the file to the next array header, or 0 in the last one. |
| 10 | 2 | u16 | cxDisplay | The width of the screen this image was made for, in pixels; 0 for any screen. |
| 12 | 2 | u16 | cyDisplay | The height of that screen; 0 for any screen. |
Telling it apart
The file starts with BA (42 41), and the two bytes at offset
14 are a second type code: BM, IC, CI,
PT or CP. That type says what each entry holds. To list the
entries, follow offNext from header to header until it is 0.
Also used for
- Windows icon .ico