2.3.11 State Record Types
The State record types specify graphics properties that define the playback device context during the processing of EMF metafile records. For more information about the state used for metafile playback, see the Abstract Data Model section 3.1.1.
Note: The EMR_REALIZEPALETTE and EMR_SAVEDC records do not specify parameters.
The following are EMF state record types.
Name |
Section |
Description |
---|---|---|
EMR_COLORMATCHTOTARGETW |
Specifies how to preview colors as they would appear on the target device. |
|
EMR_FORCEUFIMAPPING |
Forces the font mapper to match fonts based on their UniversalFontId in preference to LogFont (section 2.2.13). |
|
EMR_INVERTRGN |
Inverts the colors in the specified region. |
|
EMR_MOVETOEX |
Specifies the coordinates of a new drawing position, in logical units. |
|
EMR_PIXELFORMAT |
Specifies the pixel format. |
|
EMR_REALIZEPALETTE |
2.3.11 |
This record maps palette entries from the current LogPalette object (section 2.2.17) to the system_palette. This record specifies no parameters. |
EMR_RESTOREDC |
Restores the playback device context to the specified state, which was saved by a preceding EMR_SAVEDC record. |
|
EMR_SAVEDC |
2.3.11 |
Saves the current state of the playback device context in an array of states saved by preceding EMR_SAVEDC records if any. An EMR_RESTOREDC record is used to restore the state. This record specifies no parameters. |
EMR_SCALEVIEWPORTEXTEX |
Specifies the viewport by using the ratios formed by the specified multiplicands and divisors. |
|
EMR_SCALEWINDOWEXTEX |
Specifies the window by using the ratios formed by the specified multiplicands and divisors. |
|
EMR_SETARCDIRECTION |
Specifies the drawing direction to be used for arc and rectangle output. |
|
EMR_SETBKCOLOR |
Specifies the background color. |
|
EMR_SETBKMODE |
Specifies the background mode, which determines how to combine the background with foreground text, hatched brushes, and pen styles that are not solid lines. |
|
EMR_SETBRUSHORGEX |
Specifies the origin of the current brush. |
|
EMR_SETCOLORADJUSTMENT |
Specifies color adjustment values to use in bitmap stretching. |
|
EMR_SETICMMODE |
Specifies ICM to be enabled, disabled, or queried. |
|
EMR_SETICMPROFILEA |
Specifies how to set a specified color profile as the output profile. |
|
EMR_SETICMPROFILEW |
Specifies how to set a specified color profile as the output profile. |
|
EMR_SETLAYOUT |
Specifies the layout of the playback device context. |
|
EMR_SETLINKEDUFIS |
Sets the UniversalFontId (section 2.2.27) of the linked fonts to use during character lookup. |
|
EMR_SETMAPMODE |
Specifies the mapping mode. |
|
EMR_SETMAPPERFLAGS |
Specifies the algorithm the font mapper uses when it maps logical fonts to physical fonts. |
|
EMR_SETMITERLIMIT |
Specifies the limit for the length of miter joins. |
|
EMR_SETPOLYFILLMODE |
Defines polygon fill mode. |
|
EMR_SETROP2 |
Defines a binary raster operation mode. |
|
EMR_SETSTRETCHBLTMODE |
Specifies bitmap stretch mode. |
|
EMR_SETTEXTALIGN |
Specifies text alignment. |
|
EMR_SETTEXTCOLOR |
Defines the current text color. |
|
EMR_SETTEXTJUSTIFICATION |
Sets the amount of extra space to add to break characters for justification purposes. |
|
EMR_SETVIEWPORTEXTEX |
Defines the viewport extent. |
|
EMR_SETVIEWPORTORGEX |
Defines the viewport origin. |
|
EMR_SETWINDOWEXTEX |
Defines the window extent. |
|
EMR_SETWINDOWORGEX |
Defines the window origin. |
The generic structure of state records is specified as follows.
|
|
|
|
|
|
|
|
|
|
1 |
|
|
|
|
|
|
|
|
|
2 |
|
|
|
|
|
|
|
|
|
3 |
|
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Type |
|||||||||||||||||||||||||||||||
Size |
|||||||||||||||||||||||||||||||
StateRecordBuffer (variable, optional) |
|||||||||||||||||||||||||||||||
... |
Type (4 bytes): An unsigned integer that defines the type of record. The state record types are listed in the following table. See the preceding table for descriptions of these record types.
-
Name
Value
EMR_SETWINDOWORGEX
0x0000000A
EMR_SETVIEWPORTEXTEX
0x0000000B
EMR_SETVIEWPORTORGEX
0x0000000C
EMR_SETBRUSHORGEX
0x0000000D
EMR_SETCOLORADJUSTMENT
0x00000017
EMR_MOVETOEX
0x0000001B
EMR_SCALEVIEWPORTEXTEX
0x0000001F
EMR_SETWINDOWEXTEX
0x00000009
EMR_SETMAPPERFLAGS
0x00000010
EMR_SETMAPMODE
0x00000011
EMR_SETBKMODE
0x00000012
EMR_SETPOLYFILLMODE
0x00000013
EMR_SETROP2
0x00000014
EMR_SETSTRETCHBLTMODE
0x00000015
EMR_SETTEXTALIGN
0x00000016
EMR_SETTEXTCOLOR
0x00000018
EMR_SETBKCOLOR
0x00000019
EMR_SCALEWINDOWEXTEX
0x00000020
EMR_SAVEDC
0x00000021
EMR_RESTOREDC
0x00000022
EMR_REALIZEPALETTE
0x00000034
EMR_SETARCDIRECTION
0x00000039
EMR_SETMITERLIMIT
0x0000003A
EMR_INVERTRGN
0x00000049
EMR_SETICMMODE
0x00000062
EMR_PIXELFORMAT
0x00000068
EMR_FORCEUFIMAPPING
0x0000006D
EMR_SETICMPROFILEA
0x00000070
EMR_SETICMPROFILEW
0x00000071
EMR_SETLAYOUT
0x00000073
EMR_SETLINKEDUFIS
0x00000077
EMR_SETTEXTJUSTIFICATION
0x00000078
EMR_COLORMATCHTOTARGETW
0x00000079
Size (4 bytes): An unsigned integer that specifies the size in bytes of this record in the metafile. This value MUST be a multiple of 4 bytes.
StateRecordBuffer (variable, optional): An array of bytes that contains the remainder of the state record.
-
The EMR_REALIZEPALETTE and EMR_SAVEDC records do not contain this field.
-
0
1
2
3
4
5
6
7
8
91
0
1
2
3
4
5
6
7
8
92
0
1
2
3
4
5
6
7
8
93
0
1StateRecordParm (variable)
...
AlignmentPadding (variable, optional)
...
-
StateRecordParm (variable): An array of bytes that contains the parameters for the state record.
-
AlignmentPadding (variable, optional): An array of up to 3 bytes that pads the record so that its total size is a multiple of 4 bytes. This field MUST be ignored.
See section 2.3 for more EMF record types.