1.3.1 Metafile Structure

WMF specifies structures for defining a graphical image. A WMF metafile contains drawing commands, property definitions, and graphics objects in a series of WMF records. In effect, a WMF metafile is a digital recording of an image, and the recording can be played back to reproduce that image. Because WMF metafiles are application-independent, they can be shared among applications and used for image storage.

Original WMF metafiles were device-specific; that is, the graphical images they contained would only be rendered correctly if played back on the output device for which they were recorded. To overcome this limitation, "placeable" WMF metafiles were developed, which contain an extension to the standard header with information about the placement and scaling of the image.

The following figure illustrates the high-level structures of the original and placeable forms of WMF metafile.

Structures of original and placeable Windows metafiles

Figure 1: Structures of original and placeable Windows metafiles

The META_HEADER Record (section 2.3.2.2) contains information that defines the characteristics of the metafile, including:

  • The type of the metafile

  • The version of the metafile

  • The size of the metafile

  • The number of objects defined in the metafile

  • The size of the largest single record in the metafile

The META_PLACEABLE Record (section 2.3.2.3) contains extended information concerning the image, including:

  • A bounding rectangle

  • Logical unit size, for scaling

  • A checksum, for validation

WMF records have a generic format, which is specified in section 2.3. Every WMF record contains the following information:

  • The record size

  • The record function

  • Parameters, if any, for the record function

All WMF metafiles are terminated by a META_EOF Record (section 2.3.2.1).