libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
WMF Size in bytes of core record types.

Macros

#define U_SIZE_PAIRF   8
 
#define U_SIZE_COLORREF   4
 
#define U_SIZE_BRUSH   8
 
#define U_SIZE_FONT   19
 
#define U_SIZE_FONT_CORE   18
 
#define U_SIZE_PLTNTRY   4
 
#define U_SIZE_PALETTE   8
 
#define U_SIZE_PEN   10
 
#define U_SIZE_POINT16   4
 
#define U_SIZE_RECT16   8
 
#define U_SIZE_REGION   20
 
#define U_SIZE_BITMAP16   10
 
#define U_SIZE_BITMAPCOREHEADER   12
 
#define U_SIZE_BITMAPINFOHEADER   40
 
#define U_SIZE_BITMAPV4HEADER   108
 
#define U_SIZE_BITMAPV5HEADER   124
 
#define U_SIZE_WLOGBRUSH   8
 
#define U_SIZE_POLYPOLYGON   4
 
#define U_SIZE_SCAN   8
 
#define U_SIZE_METARECORD   6
 
#define U_SIZE_WMRPLACEABLE   22
 
#define U_SIZE_WMRHEADER   18
 
#define U_SIZE_WMREOF   6
 
#define U_SIZE_WMRSETRELABS   6
 
#define U_SIZE_WMRSAVEDC   6
 
#define U_SIZE_WMRRESTOREDC   8
 
#define U_SIZE_WMRREALIZEPALETTE   6
 
#define U_SIZE_WMRSETBKCOLOR   10
 
#define U_SIZE_WMRSETTEXTCOLOR   10
 
#define U_SIZE_WMRSETBKMODE   8
 
#define U_SIZE_WMRSETROP2   8
 
#define U_SIZE_WMRSETPOLYFILLMODE   8
 
#define U_SIZE_WMRSETSTRETCHBLTMODE   8
 
#define U_SIZE_WMRSETTEXTALIGN   8
 
#define U_SIZE_WMRSETMAPMODE   8
 
#define U_SIZE_WMRSETTEXTCHAREXTRA   8
 
#define U_SIZE_WMRSETTEXTJUSTIFICATION   10
 
#define U_SIZE_WMRSETWINDOWORG   10
 
#define U_SIZE_WMRSETWINDOWEXT   10
 
#define U_SIZE_WMRSETVIEWPORTORG   10
 
#define U_SIZE_WMRSETVIEWPORTEXT   10
 
#define U_SIZE_WMROFFSETWINDOWORG   10
 
#define U_SIZE_WMROFFSETVIEWPORTORG   10
 
#define U_SIZE_WMRLINETO   10
 
#define U_SIZE_WMRMOVETO   10
 
#define U_SIZE_WMROFFSETCLIPRGN   10
 
#define U_SIZE_WMRSCALEWINDOWEXT   14
 
#define U_SIZE_WMRSCALEVIEWPORTEXT   14
 
#define U_SIZE_WMREXCLUDECLIPRECT   14
 
#define U_SIZE_WMRINTERSECTCLIPRECT   14
 
#define U_SIZE_WMRARC   22
 
#define U_SIZE_WMRELLIPSE   14
 
#define U_SIZE_WMRRECTANGLE   14
 
#define U_SIZE_WMRFLOODFILL   16
 
#define U_SIZE_WMREXTFLOODFILL   16
 
#define U_SIZE_WMRSETPIXEL   14
 
#define U_SIZE_WMRPIE   22
 
#define U_SIZE_WMRCHORD   22
 
#define U_SIZE_WMRROUNDRECT   18
 
#define U_SIZE_WMRPATBLT   18
 
#define U_SIZE_WMRTEXTOUT   8
 
#define U_SIZE_WMRBITBLT_NOPX   24
 
#define U_SIZE_WMRBITBLT_PX   22
 
#define U_SIZE_WMRSTRETCHBLT_NOPX   28
 
#define U_SIZE_WMRSTRETCHBLT_PX   26
 
#define U_SIZE_WMRPOLYGON   10
 
#define U_SIZE_WMRPOLYLINE   10
 
#define U_SIZE_WMRESCAPE   10
 
#define U_SIZE_WMRFILLREGION   10
 
#define U_SIZE_WMRFRAMEREGION   14
 
#define U_SIZE_WMRINVERTREGION   8
 
#define U_SIZE_WMRPAINTREGION   8
 
#define U_SIZE_WMRSELECTCLIPREGION   8
 
#define U_SIZE_WMRSELECTOBJECT   8
 
#define U_SIZE_WMRSELECTPALETTE   8
 
#define U_SIZE_WMRRESIZEPALETTE   8
 
#define U_SIZE_WMRDELETEOBJECT   8
 
#define U_SIZE_WMRDRAWTEXT   6
 
#define U_SIZE_WMRCREATEBITMAPINDIRECT   6
 
#define U_SIZE_WMRCREATEBITMAP   6
 
#define U_SIZE_WMRSETMAPPERFLAGS   10
 
#define U_SIZE_WMREXTTEXTOUT   14
 
#define U_SIZE_WMRSETDIBTODEV   22
 
#define U_SIZE_WMRANIMATEPALETTE   14
 
#define U_SIZE_WMRSETPALENTRIES   14
 
#define U_SIZE_WMRCREATEPALETTE   14
 
#define U_SIZE_WMRPOLYPOLYGON   10
 
#define U_SIZE_WMRDIBBITBLT_NOPX   24
 
#define U_SIZE_WMRDIBBITBLT_PX   22
 
#define U_SIZE_WMRDIBSTRETCHBLT_NOPX   28
 
#define U_SIZE_WMRDIBSTRETCHBLT_PX   26
 
#define U_SIZE_WMRDIBCREATEPATTERNBRUSH   10
 
#define U_SIZE_WMRSTRETCHDIB   28
 
#define U_SIZE_WMRCREATEPATTERNBRUSH   6
 
#define U_SIZE_WMRCREATEPENINDIRECT   16
 
#define U_SIZE_WMRCREATEFONTINDIRECT   26
 
#define U_SIZE_WMRCREATEBRUSHINDIRECT   14
 
#define U_SIZE_WMRCREATEREGION   26
 

Detailed Description

The size of the object/record is USUALLY not the same as the sizeof() of the corresponding struct, so in general it is unsafe to use sizeof() with this code.

Always use the U_SIZE_x instead!!!!

Note that some records may actually be much, much longer than their minimum size as they include strings, bitmaps, and such.

Documentation for each value is: 
    + = same as struct size
       or
    X = different from struct size
       followed by
    Number (sizeof(struct) == size of the struct in bytes.)

Macro Definition Documentation

#define U_SIZE_BITMAP16   10
  • 10
#define U_SIZE_BITMAPCOREHEADER   12
  • 12
#define U_SIZE_BITMAPINFOHEADER   40
  • 40
#define U_SIZE_BITMAPV4HEADER   108

? 108 not tested

#define U_SIZE_BITMAPV5HEADER   124

? 124 not tested

#define U_SIZE_BRUSH   8
  • 8
#define U_SIZE_COLORREF   4
  • 4
#define U_SIZE_FONT   19

X 20

#define U_SIZE_FONT_CORE   18

X 20 Like U_FONT, but minus the FaceName part

#define U_SIZE_METARECORD   6

X 8

#define U_SIZE_PAIRF   8
  • 8 this might be different on 64 bit platform
#define U_SIZE_PALETTE   8
  • 8
#define U_SIZE_PEN   10
  • 10
#define U_SIZE_PLTNTRY   4
  • 4
#define U_SIZE_POINT16   4
  • 4
#define U_SIZE_POLYPOLYGON   4
  • 4
#define U_SIZE_RECT16   8
  • 8
#define U_SIZE_REGION   20

X 22 20 is minums the variable part

#define U_SIZE_SCAN   8
  • 8
#define U_SIZE_WLOGBRUSH   8
  • 8
#define U_SIZE_WMRANIMATEPALETTE   14

X 16

#define U_SIZE_WMRARC   22

X 24

#define U_SIZE_WMRBITBLT_NOPX   24
  • 24
#define U_SIZE_WMRBITBLT_PX   22

X 32

#define U_SIZE_WMRCHORD   22

X 24

#define U_SIZE_WMRCREATEBITMAP   6

X 8

#define U_SIZE_WMRCREATEBITMAPINDIRECT   6

X 8

#define U_SIZE_WMRCREATEBRUSHINDIRECT   14

X 16

#define U_SIZE_WMRCREATEFONTINDIRECT   26

X 28

#define U_SIZE_WMRCREATEPALETTE   14

X 16

#define U_SIZE_WMRCREATEPATTERNBRUSH   6

X 8

#define U_SIZE_WMRCREATEPENINDIRECT   16
  • 16
#define U_SIZE_WMRCREATEREGION   26

X 28

#define U_SIZE_WMRDELETEOBJECT   8
  • 8
#define U_SIZE_WMRDIBBITBLT_NOPX   24
  • 24
#define U_SIZE_WMRDIBBITBLT_PX   22

X 24

#define U_SIZE_WMRDIBCREATEPATTERNBRUSH   10

X 12

#define U_SIZE_WMRDIBSTRETCHBLT_NOPX   28
  • 28
#define U_SIZE_WMRDIBSTRETCHBLT_PX   26

X 28

#define U_SIZE_WMRDRAWTEXT   6

X 8

#define U_SIZE_WMRELLIPSE   14

X 16

#define U_SIZE_WMREOF   6

X 8

#define U_SIZE_WMRESCAPE   10

X 12 Data field could be completely absent

#define U_SIZE_WMREXCLUDECLIPRECT   14

X 16

#define U_SIZE_WMREXTFLOODFILL   16
  • 16
#define U_SIZE_WMREXTTEXTOUT   14

X 16

#define U_SIZE_WMRFILLREGION   10

X 12

#define U_SIZE_WMRFLOODFILL   16
  • 16
#define U_SIZE_WMRFRAMEREGION   14

X 16

#define U_SIZE_WMRHEADER   18

X 20

#define U_SIZE_WMRINTERSECTCLIPRECT   14

X 16

#define U_SIZE_WMRINVERTREGION   8
  • 8
#define U_SIZE_WMRLINETO   10

X 12

#define U_SIZE_WMRMOVETO   10

X 12

#define U_SIZE_WMROFFSETCLIPRGN   10

X 12

#define U_SIZE_WMROFFSETVIEWPORTORG   10

X 12

#define U_SIZE_WMROFFSETWINDOWORG   10

X 12

#define U_SIZE_WMRPAINTREGION   8
  • 8
#define U_SIZE_WMRPATBLT   18

X 20

#define U_SIZE_WMRPIE   22

X 24

#define U_SIZE_WMRPLACEABLE   22

X 24

#define U_SIZE_WMRPOLYGON   10

X 12

#define U_SIZE_WMRPOLYLINE   10

X 12

#define U_SIZE_WMRPOLYPOLYGON   10

X 12

#define U_SIZE_WMRREALIZEPALETTE   6

X 8

#define U_SIZE_WMRRECTANGLE   14

X 16

#define U_SIZE_WMRRESIZEPALETTE   8
  • 8
#define U_SIZE_WMRRESTOREDC   8
  • 8
#define U_SIZE_WMRROUNDRECT   18

X 20

#define U_SIZE_WMRSAVEDC   6

X 8

#define U_SIZE_WMRSCALEVIEWPORTEXT   14

X 16

#define U_SIZE_WMRSCALEWINDOWEXT   14

X 16

#define U_SIZE_WMRSELECTCLIPREGION   8
  • 8
#define U_SIZE_WMRSELECTOBJECT   8
  • 8
#define U_SIZE_WMRSELECTPALETTE   8
  • 8
#define U_SIZE_WMRSETBKCOLOR   10

X 12

#define U_SIZE_WMRSETBKMODE   8

X 12 last 2 bytes are optional

#define U_SIZE_WMRSETDIBTODEV   22

X 28

#define U_SIZE_WMRSETMAPMODE   8
  • 8
#define U_SIZE_WMRSETMAPPERFLAGS   10

X 12

#define U_SIZE_WMRSETPALENTRIES   14

X 16

#define U_SIZE_WMRSETPIXEL   14

X 16

#define U_SIZE_WMRSETPOLYFILLMODE   8

X 12 last 2 bytes are optional

#define U_SIZE_WMRSETRELABS   6

X 8

#define U_SIZE_WMRSETROP2   8

X 12 last 2 bytes are optional

#define U_SIZE_WMRSETSTRETCHBLTMODE   8

X 12 last 2 bytes are optional

#define U_SIZE_WMRSETTEXTALIGN   8

X 12 last 2 bytes are optional

#define U_SIZE_WMRSETTEXTCHAREXTRA   8
  • 8
#define U_SIZE_WMRSETTEXTCOLOR   10

X 12

#define U_SIZE_WMRSETTEXTJUSTIFICATION   10

X 12

#define U_SIZE_WMRSETVIEWPORTEXT   10

X 12

#define U_SIZE_WMRSETVIEWPORTORG   10

X 12

#define U_SIZE_WMRSETWINDOWEXT   10

X 12

#define U_SIZE_WMRSETWINDOWORG   10

X 12

#define U_SIZE_WMRSTRETCHBLT_NOPX   28
  • 28
#define U_SIZE_WMRSTRETCHBLT_PX   26

X 36

#define U_SIZE_WMRSTRETCHDIB   28

X 32

#define U_SIZE_WMRTEXTOUT   8

X 12 (not including String,y,x)