74.2.1 Enhanced Metafile Records

An enhanced metafile is an array of records and a record is a variable-length ENHMETARECORD data structure. This data structure identifies the record type, specifies the record length, and specifies additional data (that's dependent on the record type).

The first record in an enhanced metafile is always the enhanced metafile header. The header specifies the information in the following list:

The size of the metafile (in bytes)

The dimensions of the picture frame in device units

The dimensions of the picture frame in .01 MM units

The number of records in the metafile

The offset to an optional text-description

The offset to an optional color palette

The size of the palette

The resolution of the original device in pixels

The resolution of the original device in millimeters

The header record may be followed by an optional text description (which describes the picture, lists the author's name, lists the date of creation, and so on) and /or an optional color palette (that specifies the colors which were used to create the enhanced metafile). The remaining records identify the GDI functions that were used to create the picture. (For a complete list of functions that Windows converts into metafile records ) The following hexadecimal output corresponds to a record which Win32 generated for a SetMapMode call:

0000 0011 0000 000C 0000 0004

The value 0x00000011 specifies the record type (this value corresponds to the MR_SETMAPMODE constant that is defined in the file metadef.h). The value 0x0000000C specifies the length of the record in bytes. And, the value 0x00000004 identifies the mapping mode (this value corresponds to the MM_LOENGLISH constant that is defined in the file wingdi.h).