.PTR
OS/2 pointer (PT)
Introduction
The OS/2 pointer is a black and white mouse pointer stored as a BMP file with the type
code PT. It is laid out exactly like a
black and white OS/2 icon: one 1-bit bitmap twice
the pointer’s height, holding an AND mask and an XOR mask. The two fields that a bitmap
reserves give the hotspot, the pixel that marks where the pointer points.
Pointer files are usually named .ptr. A file with versions for several
screens is a bitmap array whose entries are
PT or colour pointer images.
Software
Structure
The parts are those of a black and white icon, and the masks combine the same way: black, white, transparent or inverted. All numbers are little-endian.
0File headerPT, size, hotspot and the offset of the pixels14 bytes14DIB header width, double height, 1 bit per pixel12 to 64 bytes…Colour table two entries, black and white6 or 8 bytes…Masks 1-bit rows padded to 4 bytes, the AND mask and the XOR mask one above the othervaries
File header
| Offset | Size | Type | Name | Description |
|---|---|---|---|---|
| 0 | 2 | char[2] | usType | The signature PT (50 54). |
| 2 | 4 | u32 | cbSize | A size field; readers should not depend on it. |
| 6 | 2 | i16 | xHotspot | The hotspot’s x position within the pointer. |
| 8 | 2 | i16 | yHotspot | The hotspot’s y position within the pointer. |
| 10 | 4 | u32 | offBits | The offset from the start of the file to the mask bits. |
Telling it apart
The file starts with PT (50 54), and its DIB header gives 1
bit per pixel with a height twice the width. Apart from the type code it is identical
to an OS/2 icon. A
colour pointer starts with CP and
has a second file header.