BMP File Format Description
I used the bmp format to store the hover textures. I decided to switch to the PNG format, because there is much more support with free image tools and editors.
Header (14 Bytes)
| Field | Size | Description |
| signature | 2 | 'BM' |
| fileSize | 4 (uInt) | file size in bytes |
| reserved | 4 (uInt) | always zero |
| dataOffset | 4 (uInt) | file offset to raster data |
InfoHeader (40 Bytes)
| Field | Size | Description |
| size | 4 (uInt) | size of infoheader |
| width | 4 (uInt) | width of bitmap |
| height | 4 (uInt) | height of bitmap |
| planes | 2 (uShort) | number of planes/layers (default = 1) |
| bitCount | 2 (uShort) | bits per pixel (8 for 256 colors, 24 for true color) |
| compression | 4 (uInt) | type of compression (0 = no compression) |
| imageSize | 4 (uInt) | size of compressed image (0 if compression 0) |
| xppm | 4 (uInt) | pixels per meter (width) |
| yppm | 4 (uInt) | pixels per meter (height) |
| colorsUsed | 4 (uInt) | number of actually used colors |
| colorsImportant | 4 (uInt) | numbers that are important (0 = all) |
ColorTable (256 × 4 Bytes)
| Field | Size | Description |
| blueValue | 1 (uByte) | blue color value |
| greenValue | 1 (uByte) | green color value |
| redValue | 1 (uByte) | red color value |
| reserved | 1 (uByte) | always zero |
RasterData (if 8 bit)
| Field | Size | Description |
| colorEntry | 1 (uByte) | value from color table |
RasterData (if 24 bit)
| Field | Size | Description |
| blueValue | 1 (uByte) | blue color value |
| greenValue | 1 (uByte) | green color value |
| redValue | 1 (uByte) | red color value |
Padding for pixel rows
Please note: Don't forget the 4 bytes padding at the end of each pixel row.