Window Metafile (wmf) Reference

METAFILE OPERAND SUPPORTED
X version gd (gif) version
#define META_SETBKCOLOR 0x0201
X X
#define META_SETBKMODE 0x0102 X X
#define META_SETMAPMODE 0x0103 X X
#define META_SETROP2 0x0104 X -
#define META_SETPOLYFILLMODE 0x0106 X4 -
#define META_SETSTRETCHBLTMODE 0x0107 -3 -3
#define META_SETTEXTCOLOR 0x0209 X X
#define META_SETTEXTCHAREXTRA 0x0108 X4 -
#define META_SETWINDOWORG 0x020B X X
#define META_SETWINDOWEXT 0x020C X X
#define META_SETVIEWPORTORG 0x020D X4 X4
#define META_SETVIEWPORTEXT 0x020E X4 X4
#define META_OFFSETWINDOWORG 0x020F X4 X4
#define META_SCALEWINDOWEXT 0x0410 X4 X4
#define META_OFFSETVIEWPORTORG 0x0211 X4 X4
#define META_SCALEVIEWPORTEXT 0x0412 X4 X4
#define META_LINETO 0x0213 X X
#define META_MOVETO 0x0214 X X
#define META_EXCLUDECLIPRECT 0x0415 X -
#define META_INTERSECTCLIPRECT 0x0416 X -
#define META_ARC 0x0817 X X
#define META_ELLIPSE 0x0418 X X
#define META_FLOODFILL 0x0419 X4 X4
#define META_PIE 0x081A X X
#define META_RECTANGLE 0x041B X X
#define META_ROUNDRECT 0x061C X X
#define META_PATBLT 0x061D X46 X46
#define META_SAVEDC 0x001E X X
#define META_SETPIXEL 0x041F X X
#define META_OFFSETCLIPRGN 0x0220 X -
#define META_POLYGON 0x0324 X X
#define META_POLYLINE 0x0325 X X
#define META_ESCAPE 0x0626 -5 -5
#define META_RESTOREDC 0x0127 X X
#define META_FILLREGION 0x0228 X X
#define META_FRAMEREGION 0x0429 X -
#define META_INVERTREGION 0x012A X4 -
#define META_PAINTREGION 0x012B X4 X
#define META_SELECTCLIPREGION 0x012C X4 -
#define META_SELECTOBJECT 0x012D X X
#define META_SETTEXTALIGN 0x012E X _
#define META_CHORD 0x0830 X X
#define META_SETMAPPERFLAGS 0x0231 -3 -3
#define META_TEXTOUT 0x0521
#define META_EXTTEXTOUT 0x0a32 X
#define META_SETDIBTODEV 0x0d33 X4 X4
#define META_POLYPOLYGON 0x0538 X X
#define META_DIBBITBLT 0x0940 X7 -
#define META_DIBSTRETCHBLT 0x0b41 X7 -
#define META_EXTFLOODFILL 0x0548 X4 X4
#define META_DELETEOBJECT 0x01f0 X X
#define META_CREATEPENINDIRECT 0x02FA X X
#define META_CREATEFONTINDIRECT 0x02FB
#define META_CREATEBRUSHINDIRECT 0x02FC X X
#define META_CREATEREGION 0x06FF X4 X4
#define META_STRETCHDIB 0x0f43 X X
#define META_SETTEXTJUSTIFICATION 0x020A X4 -

These opcodes are not seen in the wild, so realworld instances of these are welcome, they all appear to get translated into the equivalent that is prefixed with DIB

#define META_BITBLT 0x0922
#define META_STRETCHBLT 0x0B23 X7 -
#define META_CREATEPATTERNBRUSH 0x01F9

These opcodes are all related to palettes, and i dont think they matter at all, information to the contrary is welcome, these are only implemented to the degree that they dont mess up object counting

#define META_SELECTPALETTE 0x0234
#define META_REALIZEPALETTE 0x0035
#define META_ANIMATEPALETTE 0x0436
#define META_SETPALENTRIES 0x0037
#define META_RESIZEPALETTE 0x0139
#define META_CREATEPALETTE 0x00f7

These opcodes are unimplemented, for the reason that i dont know what they are, no known documentation

#define META_SETRELABS 0x0105 ?2 ?2

2 What on earth is this ?
3 Personally considered unimportant, to be dealt with at my leisure.
4 Untested
5 Has no effect on the output of the wmf file.
6 Full support pending palette handling.
7 Uses ROP, see ROP SUPPORT.


Caolan.McNamara@ul.ie
libwmf home