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.
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 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, in the 12-byte or OS/2 2.x layout, 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 header, stored as in a 12-byte or OS/2 2.x bitmapvaries
Array header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | char[2] | usType | The signature BA (42 41), the constant BFT_BITMAPARRAY. |
| 2 | 4 | u32 | cbSize | The size of the BITMAPARRAYFILEHEADER2 structure. That structure holds the file header and DIB header that follow, so it is 14 + 14 + 64 = 92 bytes, or 14 + 14 + 12 = 40 in the older form; with a shorter OS/2 2.x header, 28 plus that header’s size. The explorer reports any other value. |
| 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. |
IBM names this structure BITMAPARRAYFILEHEADER2 when it holds a
BITMAPFILEHEADER2, and BITMAPARRAYFILEHEADER when the older,
12-byte header form follows it; the array header itself is the same in both. IBM
requires the device-independent version, the one with a display size of
0 × 0, to be the first entry, and says a single image needs no array
header at all.
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.
Not described
This variant has no gaps of its own: the array header is covered, and what is missing is in the bitmaps inside it. See the BMP overview for those.
Also used for
- Windows icon – Windows icons and cursors: one picture in several sizes, as bitmaps or PNGs.
Variants
- Windows bitmap (BM) – Windows 3.0 and later: a 40- to 124-byte header
- Windows 2 and OS/2 1.x bitmap (BM) – the first bitmaps, with a 12-byte header
- OS/2 2.x bitmap (BM) – a 16- to 64-byte header, with Huffman 1D and RLE24
- OS/2 bitmap array (BA) – several OS/2 bitmaps, icons or pointers for different screens, chained in one file
- OS/2 icon (IC) – a black and white OS/2 icon: AND and XOR masks in one 1-bit bitmap
- OS/2 colour icon (CI) – a colour OS/2 icon: a 1-bit mask bitmap followed by a colour image
- OS/2 pointer (PT) – a black and white OS/2 mouse pointer, with its hotspot in the header
- OS/2 colour pointer (CP) – a colour OS/2 mouse pointer: masks, a colour image and a hotspot