2.3.2 Control Record Types

This section defines the Control Record Types, which specify records that begin and end a WMF metafile.

The following are the Control Record Types.

Name Section Description
META_EOF 2.3.2.1 Specifies the end of a WMF metafile.
META_HEADER 2.3.2.2 Specifies the start of a WMF metafile.
META_PLACEABLE 2.3.2.3 Specifies the start of a placeable WMF metafile.

2.3.2.1 META_EOF Record

The META_EOF record indicates the end of the WMF metafile.

RecordSize (4 bytes): A 32-bit unsigned integer that defines the number of 16-bit WORDs in the record.

RecordFunction (2 bytes): A 16-bit unsigned integer that defines the type of this record. For META_EOF, this value MUST be 0x0000, as specified in the RecordType Enumeration table.

See section 2.3.2 for the specification of similar records.

2.3.2.2 META_HEADER Record

The META_HEADER record is the first record in a standard (nonplaceable) WMF metafile.

Type (2 bytes) A 16-bit unsigned integer that defines the type of metafile. It MUST be a value in the MetafileType enumeration (section 2.1.1.18).
HeaderSize (2 bytes) A 16-bit unsigned integer that defines the number of 16-bit words in the header.
Version (2 bytes) A 16-bit unsigned integer that defines the metafile version. It MUST be a value in the MetafileVersion enumeration (section 2.1.1.19).<54>
SizeLow (2 bytes) A 16-bit unsigned integer that defines the low-order word of the number of 16bit words in the entire metafile.
SizeHigh (2 bytes) A 16-bit unsigned integer that defines the high-order word of the number of 16bit words in the entire metafile.
NumberOfObjects (2 bytes) A 16-bit unsigned integer that specifies the number of graphics objects that are defined in the entire metafile. These objects include brushes, pens, and the other objects specified in section 2.2.1.
MaxRecord (4 bytes) A 32-bit unsigned integer that specifies the size of the largest record used in the metafile (in 16-bit elements).
NumberOfMembers (2 bytes) A 16-bit unsigned integer that is not used. It SHOULD be 0x0000.

MetafileType Enumeration (from 2.1.1.18)

The MetafileType Enumeration specifies where the metafile is stored.

 
typedef  enum 
 { 
   MEMORYMETAFILE = 0x0001, 
  DISKMETAFILE = 0x0002 
 } MetafileType; 

MEMORYMETAFILE: Metafile is stored in memory.

DISKMETAFILE: Metafile is stored on disk.

2.3.2.3 META_PLACEABLE Record

The META_PLACEABLE record is the first record in a placeable WMF metafile, which is an extension to the WMF metafile format.<55> The information in this extension allows the specification of the placement and size of the target image, which makes it adaptable to different output devices.

The META_PLACEABLE record MUST be the first record of the metafile, located immediately before the META_HEADER record (section 2.3.2.2).

Key (4 bytes): Identification value that indicates the presence of a placeable metafile header. This value MUST be 0x9AC6CDD7.

HWmf (2 bytes): The resource handle to the metafile, when the metafile is in memory. When the metafile is on disk, this field MUST contain 0x0000. This attribute of the metafile is specified in the Type field of the META_HEADER record.

BoundingBox (8 bytes): The rectangle in the playback context (or simply the destination rectangle), measured in logical units, for displaying the metafile. The size of a logical unit is specified by the Inch field.

Inch (2 bytes): The number of logical units per inch used to represent the image. This value can be used to scale an image.

By convention, an image is considered to be recorded at 1440 logical units (twips) per inch. Thus, a value of 720 specifies that the image SHOULD be rendered at twice its normal size, and a value of 2880 specifies that the image SHOULD be rendered at half its normal size.

Reserved (4 bytes): A field that is not used and MUST be set to 0x00000000.

Checksum (2 bytes): A checksum for the previous 10 16-bit values in the header. This value can be used to determine whether the metafile has become corrupted.

Reference

[MS-WMF].pdf - v20160714 Windows Metafile Format Copyright © 2016 Microsoft Corporation Release: July 14, 2016


Maintained by John Loomis, last updated 12 April 2017