2.3.4.8 EmfPlusDrawImage Record

The EmfPlusDrawImage record specifies drawing a scaled image.


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

Flags

Size

DataSize

ImageAttributesID

SrcUnit

SrcRect

...

...

...

RectData (variable)

...

Type (2 bytes): An unsigned integer that identifies this record type as EmfPlusDrawImage from the RecordType enumeration. The value MUST be 0x401A.

Flags (2 bytes): An unsigned integer that provides information about how the operation is to be performed, and about the structure of the 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

X

C

X

X

X

X

X

X

ObjectID

X (1 bit): Reserved and MUST be ignored.

C (1 bit): This bit indicates whether the data in the RectData field is compressed.

If set, RectData contains an EmfPlusRect object. If clear, RectData contains an EmfPlusRectF object.

ObjectID (1 byte): The index of an EmfPlusImage object in the EMF+ Object Table, which specifies the image to render. The value MUST be zero to 63, inclusive.

Size (4 bytes): An unsigned integer that specifies the 32-bit-aligned number of bytes in the entire record, including the 12-byte record header and record-specific data. For this record type, the value MUST be one of the following:

Value

Meaning

0x0000002C

If the C bit is set in the Flags field.

0x00000034

If the C bit is clear in the Flags field.

DataSize (4 bytes): An unsigned integer that specifies the 32-bit-aligned number of bytes of record-specific data that follows. For this record type, the value MUST be one of the following:

Value

Meaning

0x00000020

If the C bit is set in the Flags field.

0x00000028

If the C bit is clear in the Flags field.

ImageAttributesID (4 bytes): An unsigned integer that specifies the index of an optional EmfPlusImageAttributes object in the EMF+ Object Table.

SrcUnit (4 bytes): A signed integer that specifies the units of the SrcRect field. It MUST be the UnitTypePixel member of the UnitType enumeration.

SrcRect (16 bytes): An EmfPlusRectF object that specifies a portion of the image to be rendered. The portion of the image specified by this rectangle is scaled to fit the destination rectangle specified by the RectData field.

RectData (variable): Either an EmfPlusRect or EmfPlusRectF object that defines the bounding box of the image. The portion of the image specified by the SrcRect field is scaled to fit this rectangle.

An EmfPlusImage object can specify either a bitmap or a metafile.

Colors in an image can be manipulated during rendering. They can be corrected, darkened, lightened, and removed.

See section 2.3.4 for the specification of additional drawing record types.