Windows DDB (Device-Dependent Bitmap), or Windows BMP v1, is a graphics format associated with Microsoft Windows 1.0. It has only a little in common with the BMP formats that succeeded it.
This article covers both a particular file format, and the BITMAP structure on which it is based (which may be embedded in other formats).
Originally named BITMAP, the structure is often called BITMAP16, to distinguish it from the versions of BITMAP associated with later operating systems.
The structure is 14 bytes in size, with the last 4 bytes ("bmBits") being a memory pointer to the bitmap pixels.
In a file on disk, the bmBits field is usually not used (it's not clear whether some formats omit it entirely). The pixel data usually immediately follows.
|0x0002||WORD||bmWidth: Width in pixels|
|0x0004||WORD||bmHeight: Height in pixels|
|0x0006||WORD||bmWidthBytes: Width of a line in bytes|
|0x0008||BYTE||bmPlanes: Number of planes in bitmap|
|0x0009||BYTE||bmBitsPixel: Number of bits per pixel|
|0x00A0||DWORD||bmBits: Pointer to pixels|
DDB file format
Bitmap files in this format can be found in the Windows 2 DDK.
This format is not the format saved by Windows 1.0 Paint. It is generated by ICONEDIT, the Windows 1.x icon / cursor / bitmap editor.
Files begin with a 16-byte header, the last 14 bytes of which correspond to the BITMAP structure:
|0x0000||WORD||File type: 0x0002, RT_BITMAP. Top bit set if discardable.|
|0x0002||BITMAP16|| Refer to BITMAP16, above.|
bmType: Always 0x0000 for main memory bitmap
bmBits: Always zero in disk file
This is followed by the bitmap, in top-to-bottom order, with bmWidthBytes bytes per line.
- The MSWrite decoder from libwps appears to have source code for reading embedded DDB objects.