Windows Metafile Format (WMF)

A “metafile” in the Microsoft Windows environment consists of a file that contains a series of function calls directed to the Graphics Device Interface (GDI), which creates the images that appear on a device like a color VGA monitor.

To display the stored contents of a metafile, an application reads the file and executes the GDI function calls stored within to recreate a graphic image. When an object is created during “playback” of the metafile, the GDI adds the handle of the object to the first available entry in the metafile handle table. The GDI then clears the table entry corresponding to the object when it is deleted during playback, allowing the table entry to be reused when another object is created.

A Windows metafile is composed of two parts: the header, and a list of records. The header contains a description of the word size of the metafile and the number of drawing objects used (pens, brushes, or bitmaps). The record list contains the actual GDI functions.