3.2.6.1 EMR_HEADER Example

This section provides an example of the EMF EMR_HEADER record ([MS-EMF] section 2.3.4.2).

 00064B20:            01 00 00 00 84 00 00 00 3D 01 00 00 
 00064B30:68 01 00 00 4D 04 00 00 7A 02 00 00 00 00 00 00 
 00064B40:00 00 00 00 14 69 00 00 4C 4F 00 00 20 45 4D 46 
 00064B50:00 00 01 00 64 07 00 00 21 00 00 00 02 00 00 00 
 00064B60:0C 00 00 00 6C 00 00 00 00 00 00 00 E9 0E 00 00 
 00064B70:3F 0B 00 00 0D 01 00 00 CB 00 00 00 00 00 00 00 
 00064B80:00 00 00 00 00 00 00 00 FF 1B 04 00 79 19 03 00 
 00064B90:50 00 72 00 69 00 6E 00 74 00 20 00 74 00 65 00 
 00064BA0:73 00 74 00 00 00 00 00 


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Type (0x00000001)

Size (0x00000084)

Bounds (0x0000013D)

... (0x00000168)

... (0x0000044D)

... (0x0000027A)

Frame (0x00000000)

... (0x00000000)

... (0x00006914)

... (0x00004F4C)

Type (4 bytes): 0x00000001 identifies this EMF record type as EMR_HEADER.

Size (4 bytes): 0x00000084 is the record size in bytes.

Bounds (16 bytes): 0x0000013D, 0x00000168, 0x0000044D, 0x0000027A specifies the rectangular inclusive-inclusive bounds in device units of the smallest rectangle that can be drawn around the image stored in the metafile.

Frame (16 bytes): 0x00000000, 0x00000000, 0x00006914, 0x00004F4C specifies the rectangular inclusive-inclusive dimensions, in .01 millimeter units, of a rectangle that surrounds the image stored in the metafile.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Signature (0x464D4520)

Version (0x00010000)

Bytes (0x00000764)

Records (0x00000021)

Handles (0x0002)

Reserved (0x0000)

nDescription (0x0000000C)

offDescription (0x0000006C)

nPalEntries (0x00000000)

Signature (4 bytes): 0x464D4520 specifies the record signature, which consists of the ASCII string "EMF".

Version (4 bytes): 0x00010000 specifies EMF metafile interoperability.

Bytes (4 bytes): 0x00000764 specifies the size of the metafile in bytes.

Records (4 bytes): 0x00000021 specifies the number of records in the metafile.

Handles (2 bytes): 0x0002 specifies the number of indexes that will need to be defined during the processing of the metafile. These indexes correspond to graphics objects that are used in drawing commands. Index 0 is reserved for references to the metafile itself.

Reserved (2 bytes): 0x0000 is not used.

nDescription (4 bytes): 0x0000000C specifies the number of characters in the array that contains the description of the EMF metafile's contents.

offDescription (4 bytes): 0x0000006C specifies the offset from the beginning of this record to the array that contains the description of the EMF metafile's contents.

nPalEntries (4 bytes): 0x00000000 specifies the number of entries in the metafile palette. The location of the palette is specified in the EMF end-of-file record.


0


1


2


3


4


5


6


7


8


9

1
0


1


2


3


4


5


6


7


8


9

2
0


1


2


3


4


5


6


7


8


9

3
0


1

Device (0x00000B3F)

... (0x00000EE9)

Millimeters (0x0000010D)

... (0x000000CB)

cbPixelFormat (0x00000000)

offPixelFormat (0x00000000)

bOpenGL (0x00000000)

MicrometersX (0x00031979)

MicrometersY (0x00041BFF)

EmfDescription ("Print test")

Device (8 bytes): 0x00000B3F, 0x00000EE9 specifies the size of the reference device in pixels.

Millimeters (8 bytes): 0x0000010D, 0x000000CB specifies the size of the reference device in millimeters.

cbPixelFormat (4 bytes): 0x00000000 specifies the size of the PixelFormatDescriptor structure ([MS-EMF] section 2.2.22). This value indicates that no pixel format is defined.

offPixelFormat (4 bytes): 0x00000000 specifies the offset to the PixelFormatDescriptor in the metafile. In this case, no pixel format structure is present.

bOpenGL (4 bytes): 0x00000000 specifies that no OpenGL commands are present in the metafile.

MicrometersX (4 bytes): 0x00031979 specifies the horizontal size of the reference device in micrometers.

MicrometersY (4 bytes): 0x00041BFF specifies the vertical size of the reference device in micrometers.

EmfDescription (4 bytes): "Print test".