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
Functions
uwmf.c File Reference

Functions for manipulating WMF files and structures. More...

#include <stdlib.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
#include <iconv.h>
#include <wchar.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include "uwmf.h"
#include "uwmf_endian.h"

Functions

uint32_t U_wmr_values (int idx)
 Look up the full numeric type of a WMR record by type. More...
 
char * U_wmr_names (int idx)
 Look up the name of the WMR record by type. Returns U_WMR_INVALID if out of range. More...
 
char * U_wmr_escnames (int idx)
 Text description of Escape record type. More...
 
int wmr_arc_points (U_RECT16 rclBox16, U_POINT16 ArcStart16, U_POINT16 ArcEnd16, int *f1, int f2, U_PAIRF *center, U_PAIRF *start, U_PAIRF *end, U_PAIRF *size)
 Derive from bounding box and start and end arc, for WMF arc, chord, or pie records, the center, start, and end points, and the bounding rectangle. More...
 
void U_sanerect16 (U_RECT16 rc, double *left, double *top, double *right, double *bottom)
 A U_RECT16 may have its values swapped, L<->R and T<->B, this extracts the leftmost as left, and so forth. More...
 
uint32_t U_wmr_size (const U_METARECORD *record)
 Get record size in bytes from U_WMR* record, which may not be aligned. More...
 
U_FONTU_FONT_set (int16_t Height, int16_t Width, int16_t Escapement, int16_t Orientation, int16_t Weight, uint8_t Italic, uint8_t Underline, uint8_t StrikeOut, uint8_t CharSet, uint8_t OutPrecision, uint8_t ClipPrecision, uint8_t Quality, uint8_t PitchAndFamily, char *FaceName)
 Create and return a U_FONT structure. More...
 
U_PLTNTRY U_PLTNTRY_set (U_COLORREF Color)
 Create and return a U_PLTENTRY structure. More...
 
U_PALETTEU_PLTENTRY_set (uint16_t Start, uint16_t NumEntries, U_PLTNTRY *PalEntries)
 Create and return a U_PALETTE structure. More...
 
U_PEN U_PEN_set (uint16_t Style, uint16_t Width, U_COLORREF Color)
 Create and return a U_PEN structure. More...
 
U_RECT16 U_RECT16_set (U_POINT16 ul, U_POINT16 lr)
 Create and return a U_RECT16 structure from Upper Left and Lower Right corner points. More...
 
U_BITMAP16U_BITMAP16_set (const int16_t Type, const int16_t Width, const int16_t Height, const int16_t LineN, const uint8_t BitsPixel, const char *Bits)
 Create and return a U_BITMAP16 structure. More...
 
U_SCANU_SCAN_set (uint16_t count, uint16_t top, uint16_t bottom, uint16_t *ScanLines)
 Create and return a U_SCAN structure. More...
 
U_REGIONU_REGION_set (int16_t Size, int16_t sCount, int16_t sMax, U_RECT16 sRect, uint16_t *aScans)
 Create and return a U_REGION structure. More...
 
U_WLOGBRUSH U_WLOGBRUSH_set (uint16_t Style, U_COLORREF Color, uint16_t Hatch)
 Create and return a U_WLOGBRUSH structure. More...
 
U_PAIRFU_PAIRF_set (float x, float y)
 Create and return a U_PAIRF structure. More...
 
int16_t U_16_checksum (int16_t *buf, int count)
 Calculate the int16_t checksum of the buffer for the number of positions specified. This is XOR of all values. More...
 
void dumpwht (char *string, unsigned int *handle, WMFHANDLES *wht)
 Dump a WMFHANDLES structure. Not for use in production code. More...
 
int16_t * dx16_set (int32_t height, uint32_t weight, uint32_t members)
 Make up an approximate dx array to pass to U_WMREXTTEXTOUT_set(), based on character height and weight. More...
 
uint32_t U_wmr_properties (uint32_t type)
 Look up the properties (a bit map) of a type of WMR record. Bits that may be set are defined in "Draw Properties" in uemf.h, they are U_DRAW_NOTEMPTY, etc.. More...
 
char * wmr_dup (const char *wmr)
 Duplicate an WMR record. More...
 
int wmf_start (const char *name, const uint32_t initsize, const uint32_t chunksize, WMFTRACK **wt)
 Start constructing an wmf in memory. Supply the file name and initial size. More...
 
int wmf_free (WMFTRACK **wt)
 Release memory for an wmf structure in memory. Call this after wmf_finish(). More...
 
int wmf_finish (WMFTRACK *wt)
 Finalize the emf in memory and write it to the file. More...
 
int wmf_readdata (const char *filename, char **contents, size_t *length)
 Retrieve contents of an WMF file by name. More...
 
int wmf_append (U_METARECORD *rec, WMFTRACK *wt, int freerec)
 Append an WMF record to a wmf in memory. This may reallocate buf memory. More...
 
int wmf_header_append (U_METARECORD *rec, WMFTRACK *wt, int freerec)
 Append an WMF header to a wmf in memory. This may reallocate buf memory. WMF header is not a normal record, method used to figure out its size is different. More...
 
int wmf_htable_create (uint32_t initsize, uint32_t chunksize, WMFHANDLES **wht)
 Create a handle table. Entries filled with 0 are empty, entries >0 hold a handle. More...
 
int wmf_htable_delete (uint32_t *ih, WMFHANDLES *wht)
 Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with a 0. More...
 
int wmf_htable_insert (uint32_t *ih, WMFHANDLES *wht)
 Returns the index of the first free slot. Call realloc() if needed. The slot is set to handle (indicates occupied) and the peak value is adjusted. More...
 
int wmf_htable_free (WMFHANDLES **wht)
 Free all memory in an htable. Sets the pointer to NULL. More...
 
char * wdeleteobject_set (uint32_t *ihObject, WMFHANDLES *wht)
 Allocate and construct a U_WMRDELETEOBJECT record and also delete the requested object from the table. Use this function instead of calling U_WMRDELETEOBJECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wselectobject_set (uint32_t ihObject, WMFHANDLES *wht)
 Allocate and construct a U_WMRSELECTOBJECT record, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_WMRSELECTOBJECT_set() directly. Object Pointer in WMF (caller) is 0->N, so is record, so no correction to 1->N+1 needed here. More...
 
char * wcreatepenindirect_set (uint32_t *ihPen, WMFHANDLES *wht, U_PEN pen)
 Allocate and construct a U_WMRCREATEPENINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEPENINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wcreatebrushindirect_set (uint32_t *ihBrush, WMFHANDLES *wht, U_WLOGBRUSH lb)
 Allocate and construct a U_WMRCREATEBRUSHINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEBRUSHINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wcreatedibpatternbrush_srcdib_set (uint32_t *ihBrush, WMFHANDLES *wht, const uint32_t iUsage, const U_BITMAPINFO *Bmi, const uint32_t cbPx, const char *Px)
 Allocate and construct a U_WMRDIBCREATEPATTERNBRUSH record from a DIB. Use this function instead of calling U_WMRDIBCREATEPATTERNBRUSH_set() directly. More...
 
char * wcreatedibpatternbrush_srcbm16_set (uint32_t *ihBrush, WMFHANDLES *wht, const uint32_t iUsage, const U_BITMAP16 *Bm16)
 Allocate and construct a U_WMRCREATEPATTERNBRUSH record from a U_BITMAP16 object. Use this function instead of calling U_WMRCREATEPATTERNBRUSH_set() directly. More...
 
char * wcreatepatternbrush_set (uint32_t *ihBrush, WMFHANDLES *wht, U_BITMAP16 *Bm16, char *Pattern)
 Allocate and construct a U_WMRCREATEPATTERNBRUSH record, create a handle and returns it Use this function instead of calling U_WMRCREATEPATTERNBRUSH_set() directly. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH. More...
 
char * wcreatefontindirect_set (uint32_t *ihFont, WMFHANDLES *wht, U_FONT *uf)
 Allocate and construct a U_WMRCREATEFONTINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEFONTINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wcreatepalette_set (uint32_t *ihPal, WMFHANDLES *wht, U_PALETTE *up)
 Allocate and construct a U_WMRCREATEPALETTE record, create a handle and returns it Use this function instead of calling U_WMRCREATEPALETTE_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wsetpaletteentries_set (uint32_t *ihPal, WMFHANDLES *wht, const U_PALETTE *Palettes)
 Allocate and construct a U_WMRSETPALENTRIES record, create a handle and returns it Use this function instead of calling U_WMRSETPALENTRIES_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wcreateregion_set (uint32_t *ihReg, WMFHANDLES *wht, const U_REGION *Region)
 Allocate and construct a U_WMRCREATEREGION record, create a handle and returns it Use this function instead of calling U_WMRCREATEREGION() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here. More...
 
char * wbegin_path_set (void)
 Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly. More...
 
char * wend_path_set (void)
 Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly. More...
 
char * wlinecap_set (int32_t Type)
 Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly. More...
 
char * wlinejoin_set (int32_t Type)
 Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly. More...
 
char * wmiterlimit_set (int32_t limit)
 Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly. More...
 
char * U_WMRHEADER_set (U_PAIRF *size, unsigned int dpi)
 Set up fields for a (placeable) WMR_HEADER. Most of the fields are blank and are not set until all is written. Typically values are something like (8.5,11.0), 1440 (Letter paper, 1440 DPI). The scaled paper size must fit in the range 0<->32767 inclusive, because it must be represented by a signed 16bit number. If the size + dpi result in out of range values a failure will result. More...
 
char * U_WMREOF_set (void)
 Allocate and construct a U_WMREOF record. More...
 
char * U_WMRSETBKCOLOR_set (U_COLORREF Color)
 Create and return a U_WMRSETBKCOLOR record. More...
 
char * U_WMRSETBKMODE_set (uint16_t Mode)
 Create and return a U_WMRSETBKMODE record. More...
 
char * U_WMRSETMAPMODE_set (uint16_t Mode)
 Create and return a U_WMRSETMAPMODE record. More...
 
char * U_WMRSETROP2_set (uint16_t Mode)
 Create and return a U_WMRSETROP2 record. More...
 
char * U_WMRSETRELABS_set (void)
 Allocate and construct a U_WMRSETRELABS record. More...
 
char * U_WMRSETPOLYFILLMODE_set (uint16_t Mode)
 Create and return a U_WMRSETPOLYFILLMODE record. More...
 
char * U_WMRSETSTRETCHBLTMODE_set (uint16_t Mode)
 Create and return a U_WMRSETSTRETCHBLTMODE record. More...
 
char * U_WMRSETTEXTCHAREXTRA_set (uint16_t Mode)
 Create and return a U_WMRSETTEXTCHAREXTRA record. More...
 
char * U_WMRSETTEXTCOLOR_set (U_COLORREF Color)
 Create and return a U_WMRSETTEXTCOLOR record. More...
 
char * U_WMRSETTEXTJUSTIFICATION_set (uint16_t Count, uint16_t Extra)
 Create and return a U_WMRSETTEXTJUSTIFICATION record. More...
 
char * U_WMRSETWINDOWORG_set (U_POINT16 coord)
 Create and return a U_WMRSETWINDOWORG record. More...
 
char * U_WMRSETWINDOWEXT_set (U_POINT16 extent)
 Create and return a U_WMRSETWINDOWEXT record. More...
 
char * U_WMRSETVIEWPORTORG_set (U_POINT16 coord)
 Create and return a U_WMRSETVIEWPORTORG record. More...
 
char * U_WMRSETVIEWPORTEXT_set (U_POINT16 extent)
 Create and return a U_WMRSETVIEWPORTEXT record. More...
 
char * U_WMROFFSETWINDOWORG_set (U_POINT16 offset)
 Create and return a U_WMROFFSETWINDOWORG record. More...
 
char * U_WMRSCALEWINDOWEXT_set (U_POINT16 Denom, U_POINT16 Num)
 Create and return a U_WMRSCALEWINDOWEXT record. More...
 
char * U_WMROFFSETVIEWPORTORG_set (U_POINT16 offset)
 Create and return a U_WMROFFSETVIEWPORTORG record. More...
 
char * U_WMRSCALEVIEWPORTEXT_set (U_POINT16 Denom, U_POINT16 Num)
 Create and return a U_WMRSCALEVIEWPORTEXT record. More...
 
char * U_WMRLINETO_set (U_POINT16 coord)
 Create and return a U_WMRLINETO record. More...
 
char * U_WMRMOVETO_set (U_POINT16 coord)
 Create and return a U_WMRMOVETO record. More...
 
char * U_WMREXCLUDECLIPRECT_set (U_RECT16 rect)
 Create and return a U_WMREXCLUDECLIPRECT record. More...
 
char * U_WMRINTERSECTCLIPRECT_set (U_RECT16 rect)
 Create and return a U_WMRINTERSECTCLIPRECT record. More...
 
char * U_WMRARC_set (U_POINT16 StartArc, U_POINT16 EndArc, U_RECT16 rect)
 Create and return a U_WMRARC record. More...
 
char * U_WMRELLIPSE_set (U_RECT16 rect)
 Create and return a U_WMRELLIPSE record. More...
 
char * U_WMRFLOODFILL_set (uint16_t Mode, U_COLORREF Color, U_POINT16 coord)
 Create and return a U_WMRFLOODFILL record. More...
 
char * U_WMRPIE_set (U_POINT16 Radial1, U_POINT16 Radial2, U_RECT16 rect)
 Create and return a U_WMRPIE record. More...
 
char * U_WMRRECTANGLE_set (U_RECT16 rect)
 Create and return a U_WMRRECTANGLE record. More...
 
char * U_WMRROUNDRECT_set (int16_t Width, int16_t Height, U_RECT16 rect)
 Create and return a U_WMRROUNDRECT record. More...
 
char * U_WMRPATBLT_set (U_POINT16 Dst, U_POINT16 cwh, uint32_t dwRop3)
 Allocate and construct a U_WMRPATBLT record. More...
 
char * U_WMRSAVEDC_set (void)
 Allocate and construct a U_WMRSAVEDC record. More...
 
char * U_WMRSETPIXEL_set (U_COLORREF Color, U_POINT16 Coord)
 Allocate and construct a U_WMRSETPIXEL record. More...
 
char * U_WMROFFSETCLIPRGN_set (U_POINT16 offset)
 Allocate and construct a U_WMROFFSETCLIPRGN record. More...
 
char * U_WMRTEXTOUT_set (U_POINT16 Dst, char *string)
 Allocate and construct a U_WMRTEXTOUT record. More...
 
char * U_WMRBITBLT_set (U_POINT16 Dst, U_POINT16 cwh, U_POINT16 Src, uint32_t dwRop3, const U_BITMAP16 *Bm16)
 Allocate and construct a U_WMRBITBLT record. Note that unlike U_EMRBITBLT there is no scaling available - the Src and Dst rectangles must be the same size. More...
 
char * U_WMRSTRETCHBLT_set (U_POINT16 Dst, U_POINT16 cDst, U_POINT16 Src, U_POINT16 cSrc, uint32_t dwRop3, const U_BITMAP16 *Bm16)
 Allocate and construct a U_WMRSTRETCHBLT record. More...
 
char * U_WMRPOLYGON_set (uint16_t Length, const U_POINT16 *Data)
 Allocate and construct a U_WMRPOLYGON record. More...
 
char * U_WMRPOLYLINE_set (uint16_t Length, const U_POINT16 *Data)
 Allocate and construct a U_WMRPOLYLINE record. More...
 
char * U_WMRESCAPE_set (uint16_t Escape, uint16_t Length, const void *Data)
 Allocate and construct a U_WMRESCAPE record. WARNING! Only three Escape record types are fully supported: SETLINECAP, SETLINEJOIN, SETMITERLIMIT. Even these should not be set here directly, instead use the wsetlinecap_set(), wsetlinejoin_set(), or wsetmiterlimit_set() functions. Escape records created with this function, with the exception of the three named above, will not have the byte orders in Data adjusted automatically. The user code must set Data to be little endian no matter what the endianness of the current platform where the user code is running. More...
 
char * U_WMRRESTOREDC_set (int16_t DC)
 Allocate and construct a U_WMRRESTOREDC record. More...
 
char * U_WMRFILLREGION_set (uint16_t Region, uint16_t Brush)
 Allocate and construct a U_WMRFILLREGION record. More...
 
char * U_WMRFRAMEREGION_set (uint16_t Region, uint16_t Brush, int16_t Height, int16_t Width)
 Allocate and construct a U_WMRFRAMEREGION record. More...
 
char * U_WMRINVERTREGION_set (uint16_t Region)
 Allocate and construct a U_WMRINVERTREGION record. More...
 
char * U_WMRPAINTREGION_set (uint16_t Region)
 Allocate and construct a U_WMRPAINTREGION record. More...
 
char * U_WMRSELECTCLIPREGION_set (uint16_t Region)
 Allocate and construct a U_WMRSELECTCLIPREGION record. More...
 
char * U_WMRSELECTOBJECT_set (uint16_t object)
 Allocate and construct a U_WMRSELECTOBJECT record. More...
 
char * U_WMRSETTEXTALIGN_set (uint16_t Mode)
 Allocate and construct a U_WMRSETTEXTALIGN record. More...
 
char * U_WMRDRAWTEXT_set (void)
 
char * U_WMRCHORD_set (U_POINT16 Radial1, U_POINT16 Radial2, U_RECT16 rect)
 Create and return a U_WMRCHORD record. More...
 
char * U_WMRSETMAPPERFLAGS_set (uint32_t Mode)
 Allocate and construct a U_WMRSETMAPPERFLAGS record. More...
 
char * U_WMREXTTEXTOUT_set (U_POINT16 Dst, int16_t Length, uint16_t Opts, const char *string, int16_t *dx, U_RECT16 rect)
 Allocate and construct a U_WMREXTTEXTOUT record. More...
 
char * U_WMRSETDIBTODEV_set (void)
 Allocate and construct a U_WMRSETDIBTODEV record. More...
 
char * U_WMRSELECTPALETTE_set (uint16_t Palette)
 Allocate and construct a U_WMRSELECTPALETTE record. More...
 
char * U_WMRREALIZEPALETTE_set (void)
 Allocate and construct a U_WMRREALIZEPALETTE record. More...
 
char * U_WMRANIMATEPALETTE_set (U_PALETTE *Palette)
 Allocate and construct a U_WMRSETPALENTRIES record. More...
 
char * U_WMRSETPALENTRIES_set (const U_PALETTE *Palette)
 Allocate and construct a U_WMRSETPALENTRIES record. More...
 
char * U_WMRPOLYPOLYGON_set (const uint16_t nPolys, const uint16_t *aPolyCounts, const U_POINT16 *Points)
 Allocate and construct a U_WMR_POLYPOLYGON record. More...
 
char * U_WMRRESIZEPALETTE_set (uint16_t Palette)
 Allocate and construct a U_WMRRESIZEPALETTE record. More...
 
char * U_WMRDIBBITBLT_set (U_POINT16 Dst, U_POINT16 cwh, U_POINT16 Src, uint32_t dwRop3, const U_BITMAPINFO *Bmi, uint32_t cbPx, const char *Px)
 Allocate and construct a U_WMRDIBITBLT record. More...
 
char * U_WMRDIBSTRETCHBLT_set (U_POINT16 Dst, U_POINT16 cDst, U_POINT16 Src, U_POINT16 cSrc, uint32_t dwRop3, const U_BITMAPINFO *Bmi, uint32_t cbPx, const char *Px)
 Allocate and construct a U_WMRSTRETCHDIB record. More...
 
char * U_WMRDIBCREATEPATTERNBRUSH_set (const uint16_t Style, const uint16_t iUsage, const U_BITMAPINFO *Bmi, const uint32_t cbPx, const char *Px, const U_BITMAP16 *Bm16)
 Allocate and construct a U_WMRDIBCREATEPATTERNBRUSH record. Accepts an image as either a DIB (Bmi/CbPx/Px defined) or a Bitmap16 (Bm16 defined). More...
 
char * U_WMRSTRETCHDIB_set (U_POINT16 Dst, U_POINT16 cDst, U_POINT16 Src, U_POINT16 cSrc, uint16_t cUsage, uint32_t dwRop3, const U_BITMAPINFO *Bmi, uint32_t cbPx, const char *Px)
 Allocate and construct a U_WMRSTRETCHDIB record. More...
 
char * U_WMREXTFLOODFILL_set (uint16_t Mode, U_COLORREF Color, U_POINT16 coord)
 Create and return a U_WMREXTFLOODFILL record. More...
 
char * U_WMRDELETEOBJECT_set (uint16_t object)
 Create and return a U_WMRDELETEOBJECT record. More...
 
char * U_WMRCREATEPALETTE_set (U_PALETTE *Palette)
 Create and return a U_WMRCREATEPALETTE record. More...
 
char * U_WMRCREATEPATTERNBRUSH_set (U_BITMAP16 *Bm16, char *Pattern)
 Allocate and construct a U_WMRCREATEPATTERNBRUSH record. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH. More...
 
char * U_WMRCREATEPENINDIRECT_set (U_PEN pen)
 Allocate and construct a U_WMRCREATEPENINDIRECT record. More...
 
char * U_WMRCREATEFONTINDIRECT_set (U_FONT *font)
 Allocate and construct a U_WMRCREATEFONTINDIRECT record. More...
 
char * U_WMRCREATEBRUSHINDIRECT_set (U_WLOGBRUSH brush)
 Allocate and construct a U_WMRCREATEBRUSHINDIRECT record. More...
 
char * U_WMRCREATEBITMAPINDIRECT_set (void)
 
char * U_WMRCREATEBITMAP_set (void)
 
char * U_WMRCREATEREGION_set (const U_REGION *region)
 Allocate and construct a U_WMRCREATEREGION record. More...
 
int16_t * dx16_get (int32_t height, uint32_t weight, uint32_t members)
 Make up an approximate dx array to pass to U_WMREXTTEXTOUT_get(), based on character height and weight. More...
 
size_t U_WMRRECSAFE_get (const char *contents, const char *blimit)
 Return the size of a WMF record, or 0 if it is found to be invalid. A valid record will have a size that does not cause it to extend beyond the end of data in memory. A valid record will not be smaller than the smallest possible WMF record. More...
 
void U_BITMAPCOREHEADER_get (const char *BmiCh, int32_t *Size, int32_t *Width, int32_t *Height, int32_t *BitCount)
 Return parameters from a bitmapcoreheader. All are returned as 32 bit integers, regardless of their internal representation. More...
 
void U_BITMAPINFOHEADER_get (const char *Bmih, uint32_t *Size, int32_t *Width, int32_t *Height, uint32_t *Planes, uint32_t *BitCount, uint32_t *Compression, uint32_t *SizeImage, int32_t *XPelsPerMeter, int32_t *YPelsPerMeter, uint32_t *ClrUsed, uint32_t *ClrImportant)
 Return parameters from a bitinfoheader. All are returned as 32 bit integers, regardless of their internal representation. More...
 
int wget_DIB_params (const char *dib, const char **px, const U_RGBQUAD **ct, int32_t *numCt, int32_t *width, int32_t *height, int32_t *colortype, int32_t *invert)
 Assume a packed DIB and get the parameters from it, use by DBI_to_RGBA() More...
 
int wmfheader_get (const char *contents, const char *blimit, U_WMRPLACEABLE *Placeable, U_WMRHEADER *Header)
 Get data from a (placeable) WMR_HEADER. More...
 
int U_WMREOF_get (const char *contents)
 Get data from a U_WMREOF record. More...
 
int U_WMRSETBKCOLOR_get (const char *contents, U_COLORREF *Color)
 Retrieve values from a U_WMRSETBKCOLOR record. More...
 
int U_WMRSETBKMODE_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETBKMODE record. More...
 
int U_WMRSETMAPMODE_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETMAPMODE record. More...
 
int U_WMRSETROP2_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETROP2 record. More...
 
int U_WMRSETRELABS_get (const char *contents)
 Get data from a U_WMRSETRELABS record. More...
 
int U_WMRSETPOLYFILLMODE_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETPOLYFILLMODE record. More...
 
int U_WMRSETSTRETCHBLTMODE_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETSTRETCHBLTMODE record. More...
 
int U_WMRSETTEXTCHAREXTRA_get (const char *contents, uint16_t *Mode)
 Retrieve values from a U_WMRSETTEXTCHAREXTRA record. More...
 
int U_WMRSETTEXTCOLOR_get (const char *contents, U_COLORREF *Color)
 Retrieve values from a U_WMRSETTEXTCOLOR record. More...
 
int U_WMRSETTEXTJUSTIFICATION_get (const char *contents, uint16_t *Count, uint16_t *Extra)
 Retrieve values from a U_WMRSETTEXTJUSTIFICATION record. More...
 
int U_WMRSETWINDOWORG_get (const char *contents, U_POINT16 *coord)
 Retrieve values from a U_WMRSETWINDOWORG record. More...
 
int U_WMRSETWINDOWEXT_get (const char *contents, U_POINT16 *extent)
 Retrieve values from a U_WMRSETWINDOWEXT record. More...
 
int U_WMRSETVIEWPORTORG_get (const char *contents, U_POINT16 *coord)
 Retrieve values from a U_WMRSETVIEWPORTORG record. More...
 
int U_WMRSETVIEWPORTEXT_get (const char *contents, U_POINT16 *extent)
 Retrieve values from a U_WMRSETVIEWPORTEXT record. More...
 
int U_WMROFFSETWINDOWORG_get (const char *contents, U_POINT16 *offset)
 Retrieve values from a U_WMROFFSETWINDOWORG record. More...
 
int U_WMRSCALEWINDOWEXT_get (const char *contents, U_POINT16 *Denom, U_POINT16 *Num)
 Retrieve values from a U_WMRSCALEWINDOWEXT record. More...
 
int U_WMROFFSETVIEWPORTORG_get (const char *contents, U_POINT16 *offset)
 Retrieve values from a U_WMROFFSETVIEWPORTORG record. More...
 
int U_WMRSCALEVIEWPORTEXT_get (const char *contents, U_POINT16 *Denom, U_POINT16 *Num)
 Retrieve values from a U_WMRSCALEVIEWPORTEXT record. More...
 
int U_WMRLINETO_get (const char *contents, U_POINT16 *coord)
 Retrieve values from a U_WMRLINETO record. More...
 
int U_WMRMOVETO_get (const char *contents, U_POINT16 *coord)
 Retrieve values from a U_WMRMOVETO record. More...
 
int U_WMREXCLUDECLIPRECT_get (const char *contents, U_RECT16 *rect)
 Retrieve values from a U_WMREXCLUDECLIPRECT record. More...
 
int U_WMRINTERSECTCLIPRECT_get (const char *contents, U_RECT16 *rect)
 Retrieve values from a U_WMRINTERSECTCLIPRECT record. More...
 
int U_WMRARC_get (const char *contents, U_POINT16 *StartArc, U_POINT16 *EndArc, U_RECT16 *rect)
 Retrieve values from a U_WMRARC record. More...
 
int U_WMRELLIPSE_get (const char *contents, U_RECT16 *rect)
 Retrieve values from a U_WMRELLIPSE record. More...
 
int U_WMRFLOODFILL_get (const char *contents, uint16_t *Mode, U_COLORREF *Color, U_POINT16 *coord)
 Retrieve values from a U_WMRFLOODFILL record. More...
 
int U_WMRPIE_get (const char *contents, U_POINT16 *Radial1, U_POINT16 *Radial2, U_RECT16 *rect)
 Retrieve values from a U_WMRPIE record. More...
 
int U_WMRRECTANGLE_get (const char *contents, U_RECT16 *rect)
 Retrieve values from a U_WMRRECTANGLE record. More...
 
int U_WMRROUNDRECT_get (const char *contents, int16_t *Width, int16_t *Height, U_RECT16 *rect)
 Retrieve values from a U_WMRROUNDRECT record. More...
 
int U_WMRPATBLT_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cwh, uint32_t *dwRop3)
 Get data from a U_WMRPATBLT record. More...
 
int U_WMRSAVEDC_get (const char *contents)
 Get data from a U_WMRSAVEDC record. More...
 
int U_WMRSETPIXEL_get (const char *contents, U_COLORREF *Color, U_POINT16 *Coord)
 Get data from a U_WMRSETPIXEL record. More...
 
int U_WMROFFSETCLIPRGN_get (const char *contents, U_POINT16 *offset)
 Get data from a U_WMROFFSETCLIPRGN record. More...
 
int U_WMRTEXTOUT_get (const char *contents, U_POINT16 *Dst, int16_t *Length, const char **string)
 Get data from a U_WMRTEXTOUT record. More...
 
int U_WMRBITBLT_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cwh, U_POINT16 *Src, uint32_t *dwRop3, U_BITMAP16 *Bm16, const char **px)
 Get data from a U_WMRBITBLT record. Note that unlike U_EMRBITBLT there is no scaling available - the Src and Dst rectangles must be the same size. More...
 
int U_WMRSTRETCHBLT_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cDst, U_POINT16 *Src, U_POINT16 *cSrc, uint32_t *dwRop3, U_BITMAP16 *Bm16, const char **px)
 Get data from a U_WMRSTRETCHBLT record. More...
 
int U_WMRPOLYGON_get (const char *contents, uint16_t *Length, const char **Data)
 Get data from a U_WMRPOLYGON record. More...
 
int U_WMRPOLYLINE_get (const char *contents, uint16_t *Length, const char **Data)
 Get data from a U_WMRPOLYLINE record. More...
 
int U_WMRESCAPE_get (const char *contents, uint16_t *Escape, uint16_t *Length, const char **Data)
 Get data from a U_WMRESCAPE record. WARNING! Only three Escape record types are fully supported: SETLINECAP, SETLINEJOIN, SETMITERLIMIT. Even these should not be set here directly, instead use the wsetlinecap_get(), wsetlinejoin_get(), or wsetmiterlimit_get() functions. Escape records created with this function, with the exception of the three named above, will not have the byte orders in Data adjusted automatically. The user code must set Data to be little endian no matter what the endianness of the current platform where the user code is running. More...
 
int U_WMRRESTOREDC_get (const char *contents, int16_t *DC)
 Get data from a U_WMRRESTOREDC record. More...
 
int U_WMRFILLREGION_get (const char *contents, uint16_t *Region, uint16_t *Brush)
 Get data from a U_WMRFILLREGION record. More...
 
int U_WMRFRAMEREGION_get (const char *contents, uint16_t *Region, uint16_t *Brush, int16_t *Height, int16_t *Width)
 Get data from a U_WMRFRAMEREGION record. More...
 
int U_WMRINVERTREGION_get (const char *contents, uint16_t *Region)
 Get data from a U_WMRINVERTREGION record. More...
 
int U_WMRPAINTREGION_get (const char *contents, uint16_t *Region)
 Get data from a U_WMRPAINTREGION record. More...
 
int U_WMRSELECTCLIPREGION_get (const char *contents, uint16_t *Region)
 Get data from a U_WMRSELECTCLIPREGION record. More...
 
int U_WMRSELECTOBJECT_get (const char *contents, uint16_t *Object)
 Get data from a U_WMRSELECTOBJECT record. More...
 
int U_WMRSETTEXTALIGN_get (const char *contents, uint16_t *Mode)
 Get data from a U_WMRSETTEXTALIGN record. More...
 
int U_WMRDRAWTEXT_get (void)
 
int U_WMRCHORD_get (const char *contents, U_POINT16 *Radial1, U_POINT16 *Radial2, U_RECT16 *rect)
 Retrieve values from a U_WMRCHORD record. More...
 
int U_WMRSETMAPPERFLAGS_get (const char *contents, uint32_t *Mode)
 Get data from a U_WMRSETMAPPERFLAGS record. More...
 
int U_WMREXTTEXTOUT_get (const char *contents, U_POINT16 *Dst, int16_t *Length, uint16_t *Opts, const char **string, const int16_t **dx, U_RECT16 *rect)
 Get data from a U_WMREXTTEXTOUT record. More...
 
int U_WMRSETDIBTODEV_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cwh, U_POINT16 *Src, uint16_t *cUsage, uint16_t *ScanCount, uint16_t *StartScan, const char **dib)
 Get data from a U_WMRSETDIBTODEV record. More...
 
int U_WMRSELECTPALETTE_get (const char *contents, uint16_t *Palette)
 Get data from a U_WMRSELECTPALETTE record. More...
 
int U_WMRREALIZEPALETTE_get (const char *contents)
 Get data from a U_WMRREALIZEPALETTE record. More...
 
int U_WMRANIMATEPALETTE_get (const char *contents, U_PALETTE *Palette, const char **PalEntries)
 Get data from a U_WMRSETPALENTRIES record. More...
 
int U_WMRSETPALENTRIES_get (const char *contents, U_PALETTE *Palette, const char **PalEntries)
 Get data from a U_WMRSETPALENTRIES record. More...
 
int U_WMRPOLYPOLYGON_get (const char *contents, uint16_t *nPolys, const uint16_t **aPolyCounts, const char **Points)
 Get data from a U_WMR_POLYPOLYGON record. More...
 
int U_WMRRESIZEPALETTE_get (const char *contents, uint16_t *Palette)
 Get data from a U_WMRRESIZEPALETTE record. More...
 
int U_WMRDIBBITBLT_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cwh, U_POINT16 *Src, uint32_t *dwRop3, const char **dib)
 Get data from a U_WMRDIBITBLT record. More...
 
int U_WMRDIBSTRETCHBLT_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cDst, U_POINT16 *Src, U_POINT16 *cSrc, uint32_t *dwRop3, const char **dib)
 Get data from a U_WMRSTRETCHDIB record. More...
 
int U_WMRDIBCREATEPATTERNBRUSH_get (const char *contents, uint16_t *Style, uint16_t *cUsage, const char **Bm16, const char **dib)
 Get data from a U_WMRDIBCREATEPATTERNBRUSH record. Returns an image as either a DIB (Bmi/CbPx/Px defined) or a Bitmap16 (Bm16 defined). More...
 
int U_WMRSTRETCHDIB_get (const char *contents, U_POINT16 *Dst, U_POINT16 *cDst, U_POINT16 *Src, U_POINT16 *cSrc, uint16_t *cUsage, uint32_t *dwRop3, const char **dib)
 Get data from a U_WMRSTRETCHDIB record. More...
 
int U_WMREXTFLOODFILL_get (const char *contents, uint16_t *Mode, U_COLORREF *Color, U_POINT16 *coord)
 Retrieve values from a U_WMREXTFLOODFILL record. More...
 
int U_WMRDELETEOBJECT_get (const char *contents, uint16_t *Object)
 Get data from a U_WMRDELETEOBJECT record. More...
 
int U_WMRCREATEPALETTE_get (const char *contents, U_PALETTE *Palette, const char **PalEntries)
 Retrieve values from a U_WMRCREATEPALETTE record. More...
 
int U_WMRCREATEPATTERNBRUSH_get (const char *contents, U_BITMAP16 *Bm16, int *pasize, const char **Pattern)
 Get data from a U_WMRCREATEPATTERNBRUSH record. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH. More...
 
int U_WMRCREATEPENINDIRECT_get (const char *contents, U_PEN *pen)
 Get data from a U_WMRCREATEPENINDIRECT record. More...
 
int U_WMRCREATEFONTINDIRECT_get (const char *contents, const char **font)
 Get data from a U_WMRCREATEFONTINDIRECT record. More...
 
int U_WMRCREATEBRUSHINDIRECT_get (const char *contents, const char **brush)
 Get data from a U_WMRCREATEBRUSHINDIRECT record. More...
 
int U_WMRCREATEBITMAPINDIRECT_get (void)
 
int U_WMRCREATEBITMAP_get (void)
 
int U_WMRCREATEREGION_get (const char *contents, const char **Region)
 Get data from a U_WMRCREATEREGION record. More...
 

Detailed Description

Functions for manipulating WMF files and structures.

[U_WMR*]_set all take data and return a pointer to memory holding the constructed record. If something goes wrong a NULL pointer is returned. [U_WMR*]_get takes a pointer to memory and returns the length of that record as well as the values from it (in the provided fields, passed by reference.) If something goes wrong, a size of 0 is returned.

The _set material comes first, then all of the _get material.

Compile with "U_VALGRIND" defined defined to enable code which lets valgrind check each record for uninitialized data.

Compile with "SOL8" defined for Solaris 8 or 9 (Sparc).

Function Documentation

void dumpwht ( char *  string,
unsigned int *  handle,
WMFHANDLES wht 
)

Dump a WMFHANDLES structure. Not for use in production code.

Parameters
stringText to output before dumping eht structure
handleHandle
whtWMFHANDLES structure to dump
int16_t* dx16_get ( int32_t  height,
uint32_t  weight,
uint32_t  members 
)

Make up an approximate dx array to pass to U_WMREXTTEXTOUT_get(), based on character height and weight.

Take abs. value of character height, get width by multiplying by 0.6, and correct weight approximately, with formula (measured on screen for one text line of Arial). Caller is responsible for free() on the returned pointer.

Returns
pointer to dx array
Parameters
heightcharacter height (absolute value will be used)
weightLF_Weight Enumeration (character weight)
membersNumber of entries to put into dx
int16_t* dx16_set ( int32_t  height,
uint32_t  weight,
uint32_t  members 
)

Make up an approximate dx array to pass to U_WMREXTTEXTOUT_set(), based on character height and weight.

Take abs. value of character height, get width by multiplying by 0.6, and correct weight approximately, with formula (measured on screen for one text line of Arial). Caller is responsible for free() on the returned pointer.

Returns
pointer to dx array
Parameters
heightcharacter height (absolute value will be used)
weightLF_Weight Enumeration (character weight)
membersNumber of entries to put into dx
int16_t U_16_checksum ( int16_t *  buf,
int  count 
)

Calculate the int16_t checksum of the buffer for the number of positions specified. This is XOR of all values.

Returns
checksum
Parameters
bufarray of uint16_t values
countnumber of members in buf
U_BITMAP16* U_BITMAP16_set ( const int16_t  Type,
const int16_t  Width,
const int16_t  Height,
const int16_t  LineN,
const uint8_t  BitsPixel,
const char *  Bits 
)

Create and return a U_BITMAP16 structure.

Returns
pointer to the U_BITMAP16 structure, or NULL on failure
Parameters
Typebitmap Type (not described at all in the WMF PDF)
Widthbitmap width in pixels.
Heightbitmap height in scan lines.
LineNeach array line in Bits is a multiple of this (4 for a DIB)
BitsPixelnumber of adjacent color bits on each plane (R bits + G bits + B bits ????)
Bitsbitmap pixel data. Bytes contained = (((Width * BitsPixel + 15) >> 4) << 1) * Height
void U_BITMAPCOREHEADER_get ( const char *  BmiCh,
int32_t *  Size,
int32_t *  Width,
int32_t *  Height,
int32_t *  BitCount 
)

Return parameters from a bitmapcoreheader. All are returned as 32 bit integers, regardless of their internal representation.

Parameters
BmiChchar * pointer to a U_BITMAPCOREHEADER. Note, data may not be properly aligned.
Sizesize of the coreheader in bytes
Width;Width of pixel array
Height;Height of pixel array
BitCountPixel Format (BitCount Enumeration)
void U_BITMAPINFOHEADER_get ( const char *  Bmih,
uint32_t *  Size,
int32_t *  Width,
int32_t *  Height,
uint32_t *  Planes,
uint32_t *  BitCount,
uint32_t *  Compression,
uint32_t *  SizeImage,
int32_t *  XPelsPerMeter,
int32_t *  YPelsPerMeter,
uint32_t *  ClrUsed,
uint32_t *  ClrImportant 
)

Return parameters from a bitinfoheader. All are returned as 32 bit integers, regardless of their internal representation.

Parameters
Bmihchar * pointer to a U_BITMAPINFOHEADER. Note, data may not be properly aligned.
SizeStructure size in bytes
WidthBitmap width in pixels
HeightBitmap height in pixels, may be negative.
PlanesPlanes (must be 1)
BitCountBitCount Enumeration (determines number of RBG colors)
CompressionBI_Compression Enumeration
SizeImageImage size in bytes or 0 = "default size (calculated from geometry?)"
XPelsPerMeterX Resolution in pixels/meter
YPelsPerMeterY Resolution in pixels/meter
ClrUsedNumber of bmciColors in U_BITMAPINFO/U_BITMAPCOREINFO that are used by the bitmap
ClrImportantNumber of bmciColors needed (0 means all).
U_FONT* U_FONT_set ( int16_t  Height,
int16_t  Width,
int16_t  Escapement,
int16_t  Orientation,
int16_t  Weight,
uint8_t  Italic,
uint8_t  Underline,
uint8_t  StrikeOut,
uint8_t  CharSet,
uint8_t  OutPrecision,
uint8_t  ClipPrecision,
uint8_t  Quality,
uint8_t  PitchAndFamily,
char *  FaceName 
)

Create and return a U_FONT structure.

Returns
pointer to the created U_FONT structure.
Parameters
HeightHeight in Logical units
WidthAverage Width in Logical units
EscapementAngle in 0.1 degrees betweem escapement vector and X axis
OrientationAngle in 0.1 degrees between baseline and X axis
WeightLF_Weight Enumeration
ItalicLF_Italic Enumeration
UnderlineLF_Underline Enumeration
StrikeOutLF_StrikeOut Enumeration
CharSetLF_CharSet Enumeration
OutPrecisionLF_OutPrecision Enumeration
ClipPrecisionLF_ClipPrecision Enumeration
QualityLF_Quality Enumeration
PitchAndFamilyLF_PitchAndFamily Enumeration
FaceNameName of font. ANSI Latin1, null terminated.
Parameters
HeightHeight in Logical units
WidthAverage Width in Logical units
EscapementAngle in 0.1 degrees betweem escapement vector and X axis
OrientationAngle in 0.1 degrees between baseline and X axis
WeightLF_Weight Enumeration
ItalicLF_Italic Enumeration
UnderlineLF_Underline Enumeration
StrikeOutLF_StrikeOut Enumeration
CharSetLF_CharSet Enumeration
OutPrecisionLF_OutPrecision Enumeration
ClipPrecisionLF_ClipPrecision Enumeration
QualityLF_Quality Enumeration
PitchAndFamilyLF_PitchAndFamily Enumeration
FaceNameName of font. ANSI Latin1, null terminated.
U_PAIRF* U_PAIRF_set ( float  x,
float  y 
)

Create and return a U_PAIRF structure.

Returns
pointer to the created U_PAIRF structure.
Parameters
xx value
yy value
Parameters
xx value
yy value
U_PEN U_PEN_set ( uint16_t  Style,
uint16_t  Width,
U_COLORREF  Color 
)

Create and return a U_PEN structure.

Returns
the created U_PEN structure.
Parameters
StylePenStyle Enumeration
WidthWidth of Pen
ColorPen Color.
Parameters
StylePenStyle Enumeration
WidthWidth of Pen
ColorPen Color.
U_PALETTE* U_PLTENTRY_set ( uint16_t  Start,
uint16_t  NumEntries,
U_PLTNTRY PalEntries 
)

Create and return a U_PALETTE structure.

Returns
pointer to the created U_PALETTE structure.
Parameters
StartEither 0x0300 or an offset into the Palette table
NumEntriesNumber of U_LOGPLTNTRY objects
PalEntriesPointer to array of PaletteEntry Objects
Parameters
StartEither 0x0300 or an offset into the Palette table
NumEntriesNumber of U_LOGPLTNTRY objects
PalEntriesPointer to array of PaletteEntry Objects
U_PLTNTRY U_PLTNTRY_set ( U_COLORREF  Color)

Create and return a U_PLTENTRY structure.

Returns
the created U_PLTENTRY structure.
Parameters
ColorColor for the U_PLTENTRY
U_RECT16 U_RECT16_set ( U_POINT16  ul,
U_POINT16  lr 
)

Create and return a U_RECT16 structure from Upper Left and Lower Right corner points.

Parameters
ulupper left corner of rectangle
lrlower right corner of rectangle
U_REGION* U_REGION_set ( int16_t  Size,
int16_t  sCount,
int16_t  sMax,
U_RECT16  sRect,
uint16_t *  aScans 
)

Create and return a U_REGION structure.

Returns
pointer to created U_REGION structure or NULL on error
Parameters
SizeaScans in bytes + regions size in bytes (size of this header plus all U_SCAN objects?)
sCountnumber of scan objects in region (docs say scanlines, but then no way to add sizes)
sMaxlargest number of points in any scan
sRectbounding rectangle
aScansseries of U_SCAN objects to append. This is also an array of uint16_t, but should be handled as a bunch of U_SCAN objects tightly packed into the buffer.
Parameters
SizeaScans in bytes + regions size in bytes (size of this header plus all U_SCAN objects?)
sCountnumber of scan objects in region (docs say scanlines, but then no way to add sizes)
sMaxlargest number of points in any scan
sRectbounding rectangle
aScansseries of U_SCAN objects to append. This is also an array of uint16_t, but should be handled as a bunch of U_SCAN objects tightly packed into the buffer.
void U_sanerect16 ( U_RECT16  rc,
double *  left,
double *  top,
double *  right,
double *  bottom 
)

A U_RECT16 may have its values swapped, L<->R and T<->B, this extracts the leftmost as left, and so forth.

Parameters
rcU_RECT156 binary contents of an WMF file
leftthe leftmost of rc.left and rc.right
topthe topmost of rc.top and rc.bottom
rightthe rightmost of rc.left and rc.right
bottomthe bottommost of rc.top and rc.bottom
U_SCAN* U_SCAN_set ( uint16_t  count,
uint16_t  top,
uint16_t  bottom,
uint16_t *  ScanLines 
)

Create and return a U_SCAN structure.

Returns
U_SCAN structure
Parameters
countNumber of entries in the ScanLines array
topY coordinate of the top scanline
bottomY coordinate of the bottom scanline
ScanLinesArray of 16 bit left/right pairs, array has 2*count entries
Parameters
countNumber of entries in the ScanLines array
topY coordinate of the top scanline
bottomY coordinate of the bottom scanline
ScanLinesArray of 16 bit left/right pairs, array has 2*count entries
U_WLOGBRUSH U_WLOGBRUSH_set ( uint16_t  Style,
U_COLORREF  Color,
uint16_t  Hatch 
)

Create and return a U_WLOGBRUSH structure.

Returns
the created U_WLOGBRUSH structure.
Parameters
StyleBrushStyle Enumeration
ColorBrush Color value
HatchHatchStyle Enumeration
Parameters
StyleBrushStyle Enumeration
ColorBrush Color value
HatchHatchStyle Enumeration
char* U_wmr_escnames ( int  idx)

Text description of Escape record type.

Returns
name of the WMR record, "UNKNOWN_ESCAPE" if out of range.
Parameters
idxEscape record type.
char* U_wmr_names ( int  idx)

Look up the name of the WMR record by type. Returns U_WMR_INVALID if out of range.

Returns
name of the WMR record, "U_WMR_INVALID" if out of range.
Parameters
idxWMR record type.
uint32_t U_wmr_properties ( uint32_t  type)

Look up the properties (a bit map) of a type of WMR record. Bits that may be set are defined in "Draw Properties" in uemf.h, they are U_DRAW_NOTEMPTY, etc..

Returns
bitmap of WMR record properties, or U_WMR_INVALID on error or release of all memory.
Parameters
typeWMR record type. If U_WMR_INVALID release memory. (There is no U_WMR_INVALID WMR record type)
uint32_t U_wmr_size ( const U_METARECORD record)

Get record size in bytes from U_WMR* record, which may not be aligned.

Returns
number of bytes in record.
uint32_t U_wmr_values ( int  idx)

Look up the full numeric type of a WMR record by type.

Returns
Full numeric value for this type of WMR record, Returns 0xFFFFFFFF if out of range.
Parameters
idxWMR record type.

< U_WMR_EOF

< U_WMR_SETBKCOLOR

< U_WMR_SETBKMODE

< U_WMR_SETMAPMODE

< U_WMR_SETROP2

< U_WMR_SETRELABS

< U_WMR_SETPOLYFILLMODE

< U_WMR_SETSTRETCHBLTMODE

< U_WMR_SETTEXTCHAREXTRA

< U_WMR_SETTEXTCOLOR

< U_WMR_SETTEXTJUSTIFICATION

< U_WMR_SETWINDOWORG

< U_WMR_SETWINDOWEXT

< U_WMR_SETVIEWPORTORG

< U_WMR_SETVIEWPORTEXT

< U_WMR_OFFSETWINDOWORG

< U_WMR_SCALEWINDOWEXT

< U_WMR_OFFSETVIEWPORTORG

< U_WMR_SCALEVIEWPORTEXT

< U_WMR_LINETO

< U_WMR_MOVETO

< U_WMR_EXCLUDECLIPRECT

< U_WMR_INTERSECTCLIPRECT

< U_WMR_ARC

< U_WMR_ELLIPSE

< U_WMR_FLOODFILL

< U_WMR_PIE

< U_WMR_RECTANGLE

< U_WMR_ROUNDRECT

< U_WMR_PATBLT

< U_WMR_SAVEDC

< U_WMR_SETPIXEL

< U_WMR_OFFSETCLIPRGN

< U_WMR_TEXTOUT

< U_WMR_BITBLT

< U_WMR_STRETCHBLT

< U_WMR_POLYGON

< U_WMR_POLYLINE

< U_WMR_ESCAPE

< U_WMR_RESTOREDC

< U_WMR_FILLREGION

< U_WMR_FRAMEREGION

< U_WMR_INVERTREGION

< U_WMR_PAINTREGION

< U_WMR_SELECTCLIPREGION

< U_WMR_SELECTOBJECT

< U_WMR_SETTEXTALIGN

< U_WMR_DRAWTEXT

< U_WMR_CHORD

< U_WMR_SETMAPPERFLAGS

< U_WMR_EXTTEXTOUT

< U_WMR_SETDIBTODEV

< U_WMR_SELECTPALETTE

< U_WMR_REALIZEPALETTE

< U_WMR_ANIMATEPALETTE

< U_WMR_SETPALENTRIES

< U_WMR_POLYPOLYGON

< U_WMR_RESIZEPALETTE

< U_WMR_3A

< U_WMR_3B

< U_WMR_3C

< U_WMR_3D

< U_WMR_3E

< U_WMR_3F

< U_WMR_DIBBITBLT

< U_WMR_DIBSTRETCHBLT

< U_WMR_DIBCREATEPATTERNBRUSH

< U_WMR_STRETCHDIB

< U_WMR_44

< U_WMR_45

< U_WMR_46

< U_WMR_47

< U_WMR_EXTFLOODFILL

< U_WMR_49

< U_WMR_4A

< U_WMR_4B

< U_WMR_4C

< U_WMR_4D

< U_WMR_4E

< U_WMR_4F

< U_WMR_50

< U_WMR_51

< U_WMR_52

< U_WMR_53

< U_WMR_54

< U_WMR_55

< U_WMR_56

< U_WMR_57

< U_WMR_58

< U_WMR_59

< U_WMR_5A

< U_WMR_5B

< U_WMR_5C

< U_WMR_5D

< U_WMR_5E

< U_WMR_5F

< U_WMR_60

< U_WMR_61

< U_WMR_62

< U_WMR_63

< U_WMR_64

< U_WMR_65

< U_WMR_66

< U_WMR_67

< U_WMR_68

< U_WMR_69

< U_WMR_6A

< U_WMR_6B

< U_WMR_6C

< U_WMR_6D

< U_WMR_6E

< U_WMR_6F

< U_WMR_70

< U_WMR_71

< U_WMR_72

< U_WMR_73

< U_WMR_74

< U_WMR_75

< U_WMR_76

< U_WMR_77

< U_WMR_78

< U_WMR_79

< U_WMR_7A

< U_WMR_7B

< U_WMR_7C

< U_WMR_7D

< U_WMR_7E

< U_WMR_7F

< U_WMR_80

< U_WMR_81

< U_WMR_82

< U_WMR_83

< U_WMR_84

< U_WMR_85

< U_WMR_86

< U_WMR_87

< U_WMR_88

< U_WMR_89

< U_WMR_8A

< U_WMR_8B

< U_WMR_8C

< U_WMR_8D

< U_WMR_8E

< U_WMR_8F

< U_WMR_90

< U_WMR_91

< U_WMR_92

< U_WMR_93

< U_WMR_94

< U_WMR_95

< U_WMR_96

< U_WMR_97

< U_WMR_98

< U_WMR_99

< U_WMR_9A

< U_WMR_9B

< U_WMR_9C

< U_WMR_9D

< U_WMR_9E

< U_WMR_9F

< U_WMR_A0

< U_WMR_A1

< U_WMR_A2

< U_WMR_A3

< U_WMR_A4

< U_WMR_A5

< U_WMR_A6

< U_WMR_A7

< U_WMR_A8

< U_WMR_A9

< U_WMR_AA

< U_WMR_AB

< U_WMR_AC

< U_WMR_AD

< U_WMR_AE

< U_WMR_AF

< U_WMR_B0

< U_WMR_B1

< U_WMR_B2

< U_WMR_B3

< U_WMR_B4

< U_WMR_B5

< U_WMR_B6

< U_WMR_B7

< U_WMR_B8

< U_WMR_B9

< U_WMR_BA

< U_WMR_BB

< U_WMR_BC

< U_WMR_BD

< U_WMR_BE

< U_WMR_BF

< U_WMR_C0

< U_WMR_C1

< U_WMR_C2

< U_WMR_C3

< U_WMR_C4

< U_WMR_C5

< U_WMR_C6

< U_WMR_C7

< U_WMR_C8

< U_WMR_C9

< U_WMR_CA

< U_WMR_CB

< U_WMR_CC

< U_WMR_CD

< U_WMR_CE

< U_WMR_CF

< U_WMR_D0

< U_WMR_D1

< U_WMR_D2

< U_WMR_D3

< U_WMR_D4

< U_WMR_D5

< U_WMR_D6

< U_WMR_D7

< U_WMR_D8

< U_WMR_D9

< U_WMR_DA

< U_WMR_DB

< U_WMR_DC

< U_WMR_DD

< U_WMR_DE

< U_WMR_DF

< U_WMR_E0

< U_WMR_E1

< U_WMR_E2

< U_WMR_E3

< U_WMR_E4

< U_WMR_E5

< U_WMR_E6

< U_WMR_E7

< U_WMR_E8

< U_WMR_E9

< U_WMR_EA

< U_WMR_EB

< U_WMR_EC

< U_WMR_ED

< U_WMR_EE

< U_WMR_EF

< U_WMR_DELETEOBJECT

< U_WMR_F1

< U_WMR_F2

< U_WMR_F3

< U_WMR_F4

< U_WMR_F5

< U_WMR_F6

< U_WMR_CREATEPALETTE

< U_WMR_CREATEBRUSH

< U_WMR_CREATEPATTERNBRUSH

< U_WMR_CREATEPENINDIRECT

< U_WMR_CREATEFONTINDIRECT

< U_WMR_CREATEBRUSHINDIRECT

< U_WMR_CREATEBITMAPINDIRECT

< U_WMR_CREATEBITMAP

< U_WMR_CREATEREGION

int U_WMRANIMATEPALETTE_get ( const char *  contents,
U_PALETTE Palette,
const char **  PalEntries 
)

Get data from a U_WMRSETPALENTRIES record.

Returns
length of the U_WMRSETPALENTRIES record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
PaletteRedefines a set of RGB values for the current active Palette.
PalEntriesArray of Palette Entries
char* U_WMRANIMATEPALETTE_set ( U_PALETTE Palette)

Allocate and construct a U_WMRSETPALENTRIES record.

Returns
pointer to the U_WMRSETPALENTRIES record, or NULL on error.
Parameters
PaletteRedefines a set of RGB values for the current active Palette.
int U_WMRARC_get ( const char *  contents,
U_POINT16 StartArc,
U_POINT16 EndArc,
U_RECT16 rect 
)

Retrieve values from a U_WMRARC record.

Returns
length of the U_WMRARC record, or NULL on error
Parameters
contentsrecord to extract data from
StartArcStart of Arc
EndArcEnd of Arc
rectBounding rectangle.
char* U_WMRARC_set ( U_POINT16  StartArc,
U_POINT16  EndArc,
U_RECT16  rect 
)

Create and return a U_WMRARC record.

Returns
pointer to the U_WMRARC record, or NULL on error
Parameters
StartArcStart of Arc
EndArcEnd of Arc
rectBounding rectangle.
int U_WMRBITBLT_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cwh,
U_POINT16 Src,
uint32_t *  dwRop3,
U_BITMAP16 Bm16,
const char **  px 
)

Get data from a U_WMRBITBLT record. Note that unlike U_EMRBITBLT there is no scaling available - the Src and Dst rectangles must be the same size.

Returns
length of the U_WMRBITBLT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
cwhW & H for Dst and Src in logical units
SrcSource UL corner in logical units
dwRop3RasterOPeration Enumeration
Bm16bitmap16 object (fields in it are all 0 if no bitmap is used)
pxpointer to bitmap in memory, or NULL if not used
char* U_WMRBITBLT_set ( U_POINT16  Dst,
U_POINT16  cwh,
U_POINT16  Src,
uint32_t  dwRop3,
const U_BITMAP16 Bm16 
)

Allocate and construct a U_WMRBITBLT record. Note that unlike U_EMRBITBLT there is no scaling available - the Src and Dst rectangles must be the same size.

Returns
pointer to the U_WMRBITBLT record, or NULL on error.
Parameters
DstDestination UL corner in logical units
cwhW & H for Dst and Src in logical units
SrcSource UL corner in logical units
dwRop3RasterOPeration Enumeration
Bm16(Optional) bitmap16 object
int U_WMRCHORD_get ( const char *  contents,
U_POINT16 Radial1,
U_POINT16 Radial2,
U_RECT16 rect 
)

Retrieve values from a U_WMRCHORD record.

Returns
length of the U_WMRCHORD record, or NULL on error
Parameters
contentsrecord to extract data from
Radial1Start of Chord
Radial2End of Chord
rectBounding rectangle.
char* U_WMRCHORD_set ( U_POINT16  Radial1,
U_POINT16  Radial2,
U_RECT16  rect 
)

Create and return a U_WMRCHORD record.

Returns
pointer to the U_WMRCHORD record, or NULL on error
Parameters
Radial1Start of Chord
Radial2End of Chord
rectBounding rectangle.
int U_WMRCREATEBITMAP_get ( void  )

in GDI and Wine, not in WMF manual.

char* U_WMRCREATEBITMAP_set ( void  )

in GDI and Wine, not in WMF manual.

int U_WMRCREATEBITMAPINDIRECT_get ( void  )

in GDI and Wine, not in WMF manual.

char* U_WMRCREATEBITMAPINDIRECT_set ( void  )

in GDI and Wine, not in WMF manual.

int U_WMRCREATEBRUSHINDIRECT_get ( const char *  contents,
const char **  brush 
)

Get data from a U_WMRCREATEBRUSHINDIRECT record.

Returns
length of the U_WMRCREATEBRUSHINDIRECT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
brushpointer to U_WLOGBRUSH structure in memory. Pointer may not be aligned properly for structure.
char* U_WMRCREATEBRUSHINDIRECT_set ( U_WLOGBRUSH  brush)

Allocate and construct a U_WMRCREATEBRUSHINDIRECT record.

Returns
pointer to the U_WMRCREATEBRUSHINDIRECT record, or NULL on error.
Parameters
brushParameters of the brush object to create.
int U_WMRCREATEFONTINDIRECT_get ( const char *  contents,
const char **  font 
)

Get data from a U_WMRCREATEFONTINDIRECT record.

Returns
length of the U_WMRCREATEFONTINDIRECT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
fontpointer to array of U_FONT structure in memory. Pointer may not be aligned properly for structure.
char* U_WMRCREATEFONTINDIRECT_set ( U_FONT font)

Allocate and construct a U_WMRCREATEFONTINDIRECT record.

Returns
pointer to the U_WMRCREATEFONTINDIRECT record, or NULL on error.
Parameters
fontParameters of the font object to create.
int U_WMRCREATEPALETTE_get ( const char *  contents,
U_PALETTE Palette,
const char **  PalEntries 
)

Retrieve values from a U_WMRCREATEPALETTE record.

Returns
length of the U_WMRCREATEPALETTE record, or NULL on error
Parameters
contentsrecord to extract data from
PaletteCreate a Palette object.
PalEntriesArray of Palette Entries
char* U_WMRCREATEPALETTE_set ( U_PALETTE Palette)

Create and return a U_WMRCREATEPALETTE record.

Returns
pointer to the U_WMRCREATEPALETTE record, or NULL on error
Parameters
PaletteCreate a Palette object.
int U_WMRCREATEPATTERNBRUSH_get ( const char *  contents,
U_BITMAP16 Bm16,
int *  pasize,
const char **  Pattern 
)

Get data from a U_WMRCREATEPATTERNBRUSH record. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH.

Returns
length of the U_WMRCREATEPATTERNBRUSH record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
Bm16truncated Bitmap16 structure from record, only tge first 14 bytes hold data.
pasizeNumber of bytes in Pattern
Patternbyte array pattern, described by Bm16, for brush
char* U_WMRCREATEPATTERNBRUSH_set ( U_BITMAP16 Bm16,
char *  Pattern 
)

Allocate and construct a U_WMRCREATEPATTERNBRUSH record. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH.

Returns
pointer to the U_WMRCREATEPATTERNBRUSH record, or NULL on error.
Parameters
Bm16Pointer to a Bitmap16 Object, only the first 10 bytes are used.
Patternbyte array pattern, described by Bm16, for brush
int U_WMRCREATEPENINDIRECT_get ( const char *  contents,
U_PEN pen 
)

Get data from a U_WMRCREATEPENINDIRECT record.

Returns
length of the U_WMRCREATEPENINDIRECT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
penpointer to a U_PEN object to fill.
char* U_WMRCREATEPENINDIRECT_set ( U_PEN  pen)

Allocate and construct a U_WMRCREATEPENINDIRECT record.

Returns
pointer to the U_WMRCREATEPENINDIRECT record, or NULL on error.
Parameters
penParameters of the pen object to create.
int U_WMRCREATEREGION_get ( const char *  contents,
const char **  Region 
)

Get data from a U_WMRCREATEREGION record.

Returns
length of the U_WMRCREATEREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
Regionpointer to U_REGION structure in memory. Pointer may not be aligned properly for structure.
char* U_WMRCREATEREGION_set ( const U_REGION region)

Allocate and construct a U_WMRCREATEREGION record.

Returns
pointer to the U_WMRCREATEREGION record, or NULL on error.
Parameters
regionParameters of the region object to create.
int U_WMRDELETEOBJECT_get ( const char *  contents,
uint16_t *  Object 
)

Get data from a U_WMRDELETEOBJECT record.

Returns
length of the U_WMRDELETEOBJECT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
ObjectIndex of object which is made active.
char* U_WMRDELETEOBJECT_set ( uint16_t  object)

Create and return a U_WMRDELETEOBJECT record.

Returns
pointer to the U_WMRDELETEOBJECT record, or NULL on error
Parameters
objectIndex of object to delete.
int U_WMRDIBBITBLT_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cwh,
U_POINT16 Src,
uint32_t *  dwRop3,
const char **  dib 
)

Get data from a U_WMRDIBITBLT record.

Returns
length of the U_WMRDIBITBLT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
SrcSource UL corner in logical units
cwhW & H in logical units of Src and Dst
dwRop3RasterOPeration Enumeration
dibpointer to dib in WMF in memory. Most likely not aligned.
char* U_WMRDIBBITBLT_set ( U_POINT16  Dst,
U_POINT16  cwh,
U_POINT16  Src,
uint32_t  dwRop3,
const U_BITMAPINFO Bmi,
uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_WMRDIBITBLT record.

Returns
pointer to the U_WMRDIBITBLT record, or NULL on error.
Parameters
DstDestination UL corner in logical units
SrcSource UL corner in logical units
cwhW & H in logical units of Src and Dst
dwRop3RasterOPeration Enumeration
Bmi(Optional) bitmapbuffer (U_BITMAPINFO section)
cbPxSize in bytes of pixel array (row STRIDE * height, there may be some padding at the end of each row)
Px(Optional) bitmapbuffer (pixel array section )
int U_WMRDIBCREATEPATTERNBRUSH_get ( const char *  contents,
uint16_t *  Style,
uint16_t *  cUsage,
const char **  Bm16,
const char **  dib 
)

Get data from a U_WMRDIBCREATEPATTERNBRUSH record. Returns an image as either a DIB (Bmi/CbPx/Px defined) or a Bitmap16 (Bm16 defined).

Returns
length of the U_WMRDIBCREATEPATTERNBRUSH record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
StyleBrushStyle Enumeration
cUsageDIBcolors Enumeration
Bm16pointer to a U_BITMAP16 in WMF in memory. Most likely not aligned. NULL if dib is used instead.
dibpointer to a dib in WMF in memory. Most likely not aligned. NULL if Bm16 is used instead.
char* U_WMRDIBCREATEPATTERNBRUSH_set ( const uint16_t  Style,
const uint16_t  iUsage,
const U_BITMAPINFO Bmi,
const uint32_t  cbPx,
const char *  Px,
const U_BITMAP16 Bm16 
)

Allocate and construct a U_WMRDIBCREATEPATTERNBRUSH record. Accepts an image as either a DIB (Bmi/CbPx/Px defined) or a Bitmap16 (Bm16 defined).

Returns
pointer to the U_WMRDIBCREATEPATTERNBRUSH record, or NULL on error.
Parameters
StyleBrushStyle Enumeration
iUsageDIBcolors Enumeration
Bm16pointer to U_BITMAP16 object for Style U_BS_PATTERN only
cbPxSize in bytes of pixel array (row stride * height, there may be some padding at the end of each row), for use with Bmi
Pxbitmap buffer, for use with Bmi
Bmipointer to U_BITMAPINFO for all Style OTHER than U_BS_PATTERN
int U_WMRDIBSTRETCHBLT_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cDst,
U_POINT16 Src,
U_POINT16 cSrc,
uint32_t *  dwRop3,
const char **  dib 
)

Get data from a U_WMRSTRETCHDIB record.

Returns
length of the U_WMRSTRETCHDIB record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
dwRop3RasterOPeration Enumeration
dibpointer to dib in WMF in memory. Most likely not aligned.
char* U_WMRDIBSTRETCHBLT_set ( U_POINT16  Dst,
U_POINT16  cDst,
U_POINT16  Src,
U_POINT16  cSrc,
uint32_t  dwRop3,
const U_BITMAPINFO Bmi,
uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_WMRSTRETCHDIB record.

Returns
pointer to the U_WMRSTRETCHDIB record, or NULL on error.
Parameters
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
dwRop3RasterOPeration Enumeration
Bmi(Optional) bitmapbuffer (U_BITMAPINFO section)
cbPxSize in bytes of pixel array (row STRIDE * height, there may be some padding at the end of each row)
Px(Optional) bitmapbuffer (pixel array section )
int U_WMRDRAWTEXT_get ( void  )

in GDI and Wine, not in WMF manual.

char* U_WMRDRAWTEXT_set ( void  )

in GDI and Wine, not in WMF manual..

int U_WMRELLIPSE_get ( const char *  contents,
U_RECT16 rect 
)

Retrieve values from a U_WMRELLIPSE record.

Returns
length of the U_WMRELLIPSE record, or NULL on error
Parameters
contentsrecord to extract data from
rectBounding rectangle for Ellipse.
char* U_WMRELLIPSE_set ( U_RECT16  rect)

Create and return a U_WMRELLIPSE record.

Returns
pointer to the U_WMRELLIPSE record, or NULL on error
Parameters
rectBounding rectangle for Ellipse.
int U_WMREOF_get ( const char *  contents)

Get data from a U_WMREOF record.

Returns
size of record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
char* U_WMREOF_set ( void  )

Allocate and construct a U_WMREOF record.

Returns
pointer to the U_WMREOF record, or NULL on error.
int U_WMRESCAPE_get ( const char *  contents,
uint16_t *  Escape,
uint16_t *  Length,
const char **  Data 
)

Get data from a U_WMRESCAPE record. WARNING! Only three Escape record types are fully supported: SETLINECAP, SETLINEJOIN, SETMITERLIMIT. Even these should not be set here directly, instead use the wsetlinecap_get(), wsetlinejoin_get(), or wsetmiterlimit_get() functions. Escape records created with this function, with the exception of the three named above, will not have the byte orders in Data adjusted automatically. The user code must set Data to be little endian no matter what the endianness of the current platform where the user code is running.

Returns
length of the U_WMRESCAPE record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
EscapeEscape function
LengthBytes in the Data
DataArray of Length bytes
char* U_WMRESCAPE_set ( uint16_t  Escape,
uint16_t  Length,
const void *  Data 
)

Allocate and construct a U_WMRESCAPE record. WARNING! Only three Escape record types are fully supported: SETLINECAP, SETLINEJOIN, SETMITERLIMIT. Even these should not be set here directly, instead use the wsetlinecap_set(), wsetlinejoin_set(), or wsetmiterlimit_set() functions. Escape records created with this function, with the exception of the three named above, will not have the byte orders in Data adjusted automatically. The user code must set Data to be little endian no matter what the endianness of the current platform where the user code is running.

Returns
pointer to the U_WMRESCAPE record, or NULL on error.
Parameters
EscapeEscape function
LengthBytes in the Data
DataArray of Length bytes
int U_WMREXCLUDECLIPRECT_get ( const char *  contents,
U_RECT16 rect 
)

Retrieve values from a U_WMREXCLUDECLIPRECT record.

Returns
length of the U_WMREXCLUDECLIPRECT record, or NULL on error
Parameters
contentsrecord to extract data from
rectExclude rect from clipping region.
char* U_WMREXCLUDECLIPRECT_set ( U_RECT16  rect)

Create and return a U_WMREXCLUDECLIPRECT record.

Returns
pointer to the U_WMREXCLUDECLIPRECT record, or NULL on error
Parameters
rectExclude rect from clipping region.
int U_WMREXTFLOODFILL_get ( const char *  contents,
uint16_t *  Mode,
U_COLORREF Color,
U_POINT16 coord 
)

Retrieve values from a U_WMREXTFLOODFILL record.

Returns
length of the U_WMREXTFLOODFILL record, or NULL on error
Parameters
contentsrecord to extract data from
ModeFloodFill Enumeration.
ColorColor to Fill with.
coordLocation to start fill.
char* U_WMREXTFLOODFILL_set ( uint16_t  Mode,
U_COLORREF  Color,
U_POINT16  coord 
)

Create and return a U_WMREXTFLOODFILL record.

Returns
pointer to the U_WMREXTFLOODFILL record, or NULL on error
Parameters
ModeFloodFill Enumeration.
ColorColor to Fill with.
coordLocation to start fill.
int U_WMREXTTEXTOUT_get ( const char *  contents,
U_POINT16 Dst,
int16_t *  Length,
uint16_t *  Opts,
const char **  string,
const int16_t **  dx,
U_RECT16 rect 
)

Get data from a U_WMREXTTEXTOUT record.

Returns
length of the U_WMREXTTEXTOUT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
Dst{X,Y} coordinates where the string is to be written.
LengthStringlength in bytes
OptsExtTextOutOptions Flags
stringString to write (Latin1 encoding)
dxKerning information. Must have same number of entries as Length.
rectUsed when when U_ETO_OPAQUE or U_ETO_CLIPPED bits are set in Opts
char* U_WMREXTTEXTOUT_set ( U_POINT16  Dst,
int16_t  Length,
uint16_t  Opts,
const char *  string,
int16_t *  dx,
U_RECT16  rect 
)

Allocate and construct a U_WMREXTTEXTOUT record.

Returns
pointer to the U_WMREXTTEXTOUT record, or NULL on error.
Parameters
Dst{X,Y} coordinates where the string is to be written.
LengthStringlength in bytes
OptsExtTextOutOptions Flags
stringString to write (Latin1 encoding)
dxKerning information. Must have same number of entries as Length.
rectUsed when when U_ETO_OPAQUE or U_ETO_CLIPPED bits are set in Opts
int U_WMRFILLREGION_get ( const char *  contents,
uint16_t *  Region,
uint16_t *  Brush 
)

Get data from a U_WMRFILLREGION record.

Returns
length of the U_WMRFILLREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
RegionRegion to fill
BrushBrush to fill with
char* U_WMRFILLREGION_set ( uint16_t  Region,
uint16_t  Brush 
)

Allocate and construct a U_WMRFILLREGION record.

Returns
pointer to the U_WMRFILLREGION record, or NULL on error.
Parameters
RegionRegion to fill
BrushBrush to fill with
int U_WMRFLOODFILL_get ( const char *  contents,
uint16_t *  Mode,
U_COLORREF Color,
U_POINT16 coord 
)

Retrieve values from a U_WMRFLOODFILL record.

Returns
length of the U_WMRFLOODFILL record, or NULL on error
Parameters
contentsrecord to extract data from
ModeFloodFill Enumeration.
ColorColor to Fill with.
coordLocation to start fill.
char* U_WMRFLOODFILL_set ( uint16_t  Mode,
U_COLORREF  Color,
U_POINT16  coord 
)

Create and return a U_WMRFLOODFILL record.

Returns
pointer to the U_WMRFLOODFILL record, or NULL on error
Parameters
ModeFloodFill Enumeration.
ColorColor to Fill with.
coordLocation to start fill.
int U_WMRFRAMEREGION_get ( const char *  contents,
uint16_t *  Region,
uint16_t *  Brush,
int16_t *  Height,
int16_t *  Width 
)

Get data from a U_WMRFRAMEREGION record.

Returns
length of the U_WMRFRAMEREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
RegionIndex of region to frame in object table
BrushIndex of brush to use in frame in object table
Heightin logical units (of frame)
Widthin logical units (of frame)
char* U_WMRFRAMEREGION_set ( uint16_t  Region,
uint16_t  Brush,
int16_t  Height,
int16_t  Width 
)

Allocate and construct a U_WMRFRAMEREGION record.

Returns
pointer to the U_WMRFRAMEREGION record, or NULL on error.
Parameters
RegionIndex of region to frame in object table
BrushIndex of brush to use in frame in object table
Heightin logical units (of frame)
Widthin logical units (of frame)
char* U_WMRHEADER_set ( U_PAIRF size,
unsigned int  dpi 
)

Set up fields for a (placeable) WMR_HEADER. Most of the fields are blank and are not set until all is written. Typically values are something like (8.5,11.0), 1440 (Letter paper, 1440 DPI). The scaled paper size must fit in the range 0<->32767 inclusive, because it must be represented by a signed 16bit number. If the size + dpi result in out of range values a failure will result.

Returns
pointer to the WMF header record, or NULL on failure
Parameters
sizePointer to page size (if NULL, not a placeable header) in inches. Values must be positive and scaled
dpiLogical units/inch. If 0 defaults to 1440.
int U_WMRINTERSECTCLIPRECT_get ( const char *  contents,
U_RECT16 rect 
)

Retrieve values from a U_WMRINTERSECTCLIPRECT record.

Returns
length of the U_WMRINTERSECTCLIPRECT record, or NULL on error
Parameters
contentsrecord to extract data from
rectClipping region is intersection of existing clipping region with rect.
char* U_WMRINTERSECTCLIPRECT_set ( U_RECT16  rect)

Create and return a U_WMRINTERSECTCLIPRECT record.

Returns
pointer to the U_WMRINTERSECTCLIPRECT record, or NULL on error
Parameters
rectClipping region is intersection of existing clipping region with rect.
int U_WMRINVERTREGION_get ( const char *  contents,
uint16_t *  Region 
)

Get data from a U_WMRINVERTREGION record.

Returns
length of the U_WMRINVERTREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
RegionIndex of region to invert.
char* U_WMRINVERTREGION_set ( uint16_t  Region)

Allocate and construct a U_WMRINVERTREGION record.

Returns
pointer to the U_WMRINVERTREGION record, or NULL on error.
Parameters
RegionIndex of region to invert.
int U_WMRLINETO_get ( const char *  contents,
U_POINT16 coord 
)

Retrieve values from a U_WMRLINETO record.

Returns
length of the U_WMRLINETO record, or NULL on error
Parameters
contentsrecord to extract data from
coordDraw line to {X,Y}.
char* U_WMRLINETO_set ( U_POINT16  coord)

Create and return a U_WMRLINETO record.

Returns
pointer to the U_WMRLINETO record, or NULL on error
Parameters
coordDraw line to {X,Y}.
int U_WMRMOVETO_get ( const char *  contents,
U_POINT16 coord 
)

Retrieve values from a U_WMRMOVETO record.

Returns
length of the U_WMRMOVETO record, or NULL on error
Parameters
contentsrecord to extract data from
coordMove to {X,Y}.
char* U_WMRMOVETO_set ( U_POINT16  coord)

Create and return a U_WMRMOVETO record.

Returns
pointer to the U_WMRMOVETO record, or NULL on error
Parameters
coordMove to {X,Y}.
int U_WMROFFSETCLIPRGN_get ( const char *  contents,
U_POINT16 offset 
)

Get data from a U_WMROFFSETCLIPRGN record.

Returns
length of the U_WMROFFSETCLIPRGN record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
offsetpointer to a U_POINT16 variable where the x,y offsets will be stored.
char* U_WMROFFSETCLIPRGN_set ( U_POINT16  offset)

Allocate and construct a U_WMROFFSETCLIPRGN record.

Returns
pointer to the U_WMROFFSETCLIPRGN record, or NULL on error.
Parameters
offsetU_POINT16 x,y offset to apply to the clipping region.
int U_WMROFFSETVIEWPORTORG_get ( const char *  contents,
U_POINT16 offset 
)

Retrieve values from a U_WMROFFSETVIEWPORTORG record.

Returns
length of the U_WMROFFSETVIEWPORTORG record, or NULL on error
Parameters
contentsrecord to extract data from
offsetViewport offset in device units.
char* U_WMROFFSETVIEWPORTORG_set ( U_POINT16  offset)

Create and return a U_WMROFFSETVIEWPORTORG record.

Returns
pointer to the U_WMROFFSETVIEWPORTORG record, or NULL on error
Parameters
offsetViewport offset in device units.
int U_WMROFFSETWINDOWORG_get ( const char *  contents,
U_POINT16 offset 
)

Retrieve values from a U_WMROFFSETWINDOWORG record.

Returns
length of the U_WMROFFSETWINDOWORG record, or NULL on error
Parameters
contentsrecord to extract data from
offsetWindow offset in device units.
char* U_WMROFFSETWINDOWORG_set ( U_POINT16  offset)

Create and return a U_WMROFFSETWINDOWORG record.

Returns
pointer to the U_WMROFFSETWINDOWORG record, or NULL on error
Parameters
offsetWindow offset in device units.
int U_WMRPAINTREGION_get ( const char *  contents,
uint16_t *  Region 
)

Get data from a U_WMRPAINTREGION record.

Returns
length of the U_WMRPAINTREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
RegionIndex of region to paint with the current Brush.
char* U_WMRPAINTREGION_set ( uint16_t  Region)

Allocate and construct a U_WMRPAINTREGION record.

Returns
pointer to the U_WMRPAINTREGION record, or NULL on error.
Parameters
RegionIndex of region to paint with the current Brush.
int U_WMRPATBLT_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cwh,
uint32_t *  dwRop3 
)

Get data from a U_WMRPATBLT record.

Returns
length of the U_WMRPATBLT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
cwhW & H for Dst and Src in logical units
dwRop3RasterOPeration Enumeration
char* U_WMRPATBLT_set ( U_POINT16  Dst,
U_POINT16  cwh,
uint32_t  dwRop3 
)

Allocate and construct a U_WMRPATBLT record.

Returns
pointer to the U_WMRPATBLT record, or NULL on error.
Parameters
DstDestination UL corner in logical units
cwhW & H for Dst and Src in logical units
dwRop3RasterOPeration Enumeration
int U_WMRPIE_get ( const char *  contents,
U_POINT16 Radial1,
U_POINT16 Radial2,
U_RECT16 rect 
)

Retrieve values from a U_WMRPIE record.

Returns
length of the U_WMRPIE record, or NULL on error
Parameters
contentsrecord to extract data from
Radial1Start of Pie
Radial2End of Pie
rectBounding rectangle.
char* U_WMRPIE_set ( U_POINT16  Radial1,
U_POINT16  Radial2,
U_RECT16  rect 
)

Create and return a U_WMRPIE record.

Returns
pointer to the U_WMRPIE record, or NULL on error
Parameters
Radial1Start of Pie
Radial2End of Pie
rectBounding rectangle.
int U_WMRPOLYGON_get ( const char *  contents,
uint16_t *  Length,
const char **  Data 
)

Get data from a U_WMRPOLYGON record.

Returns
length of the U_WMRPOLYGON record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
LengthNumber of points in the Polygon
Datapointer to array of U_POINT16 in memory. Pointer may not be aligned properly for structures.
char* U_WMRPOLYGON_set ( uint16_t  Length,
const U_POINT16 Data 
)

Allocate and construct a U_WMRPOLYGON record.

Returns
pointer to the U_WMRPOLYGON record, or NULL on error.
Parameters
LengthNumber of points in the Polygon
DataArray of Length points
int U_WMRPOLYLINE_get ( const char *  contents,
uint16_t *  Length,
const char **  Data 
)

Get data from a U_WMRPOLYLINE record.

Returns
length of the U_WMRPOLYLINE record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
LengthNumber of points in the Polyline
Datapointer to array of U_POINT16 in memory. Pointer may not be aligned properly for structures.
char* U_WMRPOLYLINE_set ( uint16_t  Length,
const U_POINT16 Data 
)

Allocate and construct a U_WMRPOLYLINE record.

Returns
pointer to the U_WMRPOLYLINE record, or NULL on error.
Parameters
LengthNumber of points in the Polyline
DataArray of Length points
int U_WMRPOLYPOLYGON_get ( const char *  contents,
uint16_t *  nPolys,
const uint16_t **  aPolyCounts,
const char **  Points 
)

Get data from a U_WMR_POLYPOLYGON record.

Returns
length of the U_WMR_POLYPOLYGON record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
Pointspointer to array of U_POINT16 in memory. Probably not aligned.
char* U_WMRPOLYPOLYGON_set ( const uint16_t  nPolys,
const uint16_t *  aPolyCounts,
const U_POINT16 Points 
)

Allocate and construct a U_WMR_POLYPOLYGON record.

Returns
pointer to the U_WMR_POLYPOLYGON record, or NULL on error.
Parameters
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
Pointsarray of points
int U_WMRREALIZEPALETTE_get ( const char *  contents)

Get data from a U_WMRREALIZEPALETTE record.

Returns
length of the U_WMRREALIZEPALETTE record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
char* U_WMRREALIZEPALETTE_set ( void  )

Allocate and construct a U_WMRREALIZEPALETTE record.

Returns
pointer to the U_WMRREALIZEPALETTE record, or NULL on error.
size_t U_WMRRECSAFE_get ( const char *  contents,
const char *  blimit 
)

Return the size of a WMF record, or 0 if it is found to be invalid. A valid record will have a size that does not cause it to extend beyond the end of data in memory. A valid record will not be smaller than the smallest possible WMF record.

Returns
size of the record in bytes, 0 on failure
Parameters
contentsrecord to extract data from
blimitone byte past the last WMF record in memory.
int U_WMRRECTANGLE_get ( const char *  contents,
U_RECT16 rect 
)

Retrieve values from a U_WMRRECTANGLE record.

Returns
length of the U_WMRRECTANGLE record, or NULL on error
Parameters
contentsrecord to extract data from
rectBoundaries.
char* U_WMRRECTANGLE_set ( U_RECT16  rect)

Create and return a U_WMRRECTANGLE record.

Returns
pointer to the U_WMRRECTANGLE record, or NULL on error
Parameters
rectBoundaries.
int U_WMRRESIZEPALETTE_get ( const char *  contents,
uint16_t *  Palette 
)

Get data from a U_WMRRESIZEPALETTE record.

Returns
length of the U_WMRRESIZEPALETTE record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
PaletteChanges the size of the currently active Palette.
char* U_WMRRESIZEPALETTE_set ( uint16_t  Palette)

Allocate and construct a U_WMRRESIZEPALETTE record.

Returns
pointer to the U_WMRRESIZEPALETTE record, or NULL on error.
Parameters
PaletteChanges the size of the currently active Palette.
int U_WMRRESTOREDC_get ( const char *  contents,
int16_t *  DC 
)

Get data from a U_WMRRESTOREDC record.

Returns
length of the U_WMRRESTOREDC record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DCDC to restore (relative if negative, absolute if positive)
char* U_WMRRESTOREDC_set ( int16_t  DC)

Allocate and construct a U_WMRRESTOREDC record.

Returns
pointer to the U_WMRRESTOREDC record, or NULL on error.
Parameters
DCDrawing Context to restore. (negative is relative to current, positive is absolute)
int U_WMRROUNDRECT_get ( const char *  contents,
int16_t *  Width,
int16_t *  Height,
U_RECT16 rect 
)

Retrieve values from a U_WMRROUNDRECT record.

Returns
length of the U_WMRROUNDRECT record, or NULL on error
Parameters
contentsrecord to extract data from
WidthHorizontal rounding length.
HeightVertical rounding length.
rectBoundaries.
char* U_WMRROUNDRECT_set ( int16_t  Width,
int16_t  Height,
U_RECT16  rect 
)

Create and return a U_WMRROUNDRECT record.

Returns
pointer to the U_WMRROUNDRECT record, or NULL on error
Parameters
WidthHorizontal rounding length.
HeightVertical rounding length.
rectBoundaries.
int U_WMRSAVEDC_get ( const char *  contents)

Get data from a U_WMRSAVEDC record.

Returns
length of the U_WMRSAVEDC record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
char* U_WMRSAVEDC_set ( void  )

Allocate and construct a U_WMRSAVEDC record.

Returns
pointer to the U_WMRSAVEDC record, or NULL on error.
int U_WMRSCALEVIEWPORTEXT_get ( const char *  contents,
U_POINT16 Denom,
U_POINT16 Num 
)

Retrieve values from a U_WMRSCALEVIEWPORTEXT record.

Returns
length of the U_WMRSCALEVIEWPORTEXT record, or NULL on error
Parameters
contentsrecord to extract data from
Denom{X,Y} denominators.
Num{X,Y} numerators.
char* U_WMRSCALEVIEWPORTEXT_set ( U_POINT16  Denom,
U_POINT16  Num 
)

Create and return a U_WMRSCALEVIEWPORTEXT record.

Returns
pointer to the U_WMRSCALEVIEWPORTEXT record, or NULL on error
Parameters
Denom{X,Y} denominators.
Num{X,Y} numerators.
int U_WMRSCALEWINDOWEXT_get ( const char *  contents,
U_POINT16 Denom,
U_POINT16 Num 
)

Retrieve values from a U_WMRSCALEWINDOWEXT record.

Returns
length of the U_WMRSCALEWINDOWEXT record, or NULL on error
Parameters
contentsrecord to extract data from
Denom{X,Y} denominators.
Num{X,Y} numerators.
char* U_WMRSCALEWINDOWEXT_set ( U_POINT16  Denom,
U_POINT16  Num 
)

Create and return a U_WMRSCALEWINDOWEXT record.

Returns
pointer to the U_WMRSCALEWINDOWEXT record, or NULL on error
Parameters
Denom{X,Y} denominators.
Num{X,Y} numerators.
int U_WMRSELECTCLIPREGION_get ( const char *  contents,
uint16_t *  Region 
)

Get data from a U_WMRSELECTCLIPREGION record.

Returns
length of the U_WMRSELECTCLIPREGION record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
RegionIndex of region to become clipping region..
char* U_WMRSELECTCLIPREGION_set ( uint16_t  Region)

Allocate and construct a U_WMRSELECTCLIPREGION record.

Returns
pointer to the U_WMRSELECTCLIPREGION record, or NULL on error.
Parameters
RegionIndex of region to become clipping region..
int U_WMRSELECTOBJECT_get ( const char *  contents,
uint16_t *  Object 
)

Get data from a U_WMRSELECTOBJECT record.

Returns
length of the U_WMRSELECTOBJECT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
ObjectIndex of object which is made active.
char* U_WMRSELECTOBJECT_set ( uint16_t  object)

Allocate and construct a U_WMRSELECTOBJECT record.

Returns
pointer to the U_WMRSELECTOBJECT record, or NULL on error.
Parameters
objectIndex of object which is made active.
int U_WMRSELECTPALETTE_get ( const char *  contents,
uint16_t *  Palette 
)

Get data from a U_WMRSELECTPALETTE record.

Returns
length of the U_WMRSELECTPALETTE record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
PaletteIndex of Palette to make active.
char* U_WMRSELECTPALETTE_set ( uint16_t  Palette)

Allocate and construct a U_WMRSELECTPALETTE record.

Returns
pointer to the U_WMRSELECTPALETTE record, or NULL on error.
Parameters
PaletteIndex of Palette to make active.
int U_WMRSETBKCOLOR_get ( const char *  contents,
U_COLORREF Color 
)

Retrieve values from a U_WMRSETBKCOLOR record.

Returns
length of the U_WMRSETBKCOLOR record, or NULL on error
Parameters
contentsrecord to extract data from
ColorBackground Color.
char* U_WMRSETBKCOLOR_set ( U_COLORREF  Color)

Create and return a U_WMRSETBKCOLOR record.

Returns
pointer to the U_WMRSETBKCOLOR record, or NULL on error
Parameters
ColorBackground Color.
int U_WMRSETBKMODE_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETBKMODE record.

Returns
length of the U_WMRSETBKMODE record, or NULL on error
Parameters
contentsrecord to extract data from
ModeMixMode Enumeration
char* U_WMRSETBKMODE_set ( uint16_t  Mode)

Create and return a U_WMRSETBKMODE record.

Returns
pointer to the U_WMRSETBKMODE record, or NULL on error
Parameters
ModeMixMode Enumeration
int U_WMRSETDIBTODEV_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cwh,
U_POINT16 Src,
uint16_t *  cUsage,
uint16_t *  ScanCount,
uint16_t *  StartScan,
const char **  dib 
)

Get data from a U_WMRSETDIBTODEV record.

Returns
length of the U_WMRSETDIBTODEV record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstUL corner of Dst rect in logical units
cwhWidth and Height in logical units
SrcUL corner of Src rect in logical units
cUsageColorUsage enumeration
ScanCountNumber of scan lines in Src
StartScanFirst Scan line in Src
dibDeviceIndependentBitmap object
char* U_WMRSETDIBTODEV_set ( void  )

Allocate and construct a U_WMRSETDIBTODEV record.

Returns
pointer to the U_WMRSETDIBTODEV record, or NULL on error.
int U_WMRSETMAPMODE_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETMAPMODE record.

Returns
length of the U_WMRSETMAPMODE record, or NULL on error
Parameters
contentsrecord to extract data from
ModeMapMode Enumeration
char* U_WMRSETMAPMODE_set ( uint16_t  Mode)

Create and return a U_WMRSETMAPMODE record.

Returns
pointer to the U_WMRSETMAPMODE record, or NULL on error
Parameters
ModeMapMode Enumeration
int U_WMRSETMAPPERFLAGS_get ( const char *  contents,
uint32_t *  Mode 
)

Get data from a U_WMRSETMAPPERFLAGS record.

Returns
length of the U_WMRSETMAPPERFLAGS record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
ModeIf 1 bit set font mapper selects only matching aspect fonts.
char* U_WMRSETMAPPERFLAGS_set ( uint32_t  Mode)

Allocate and construct a U_WMRSETMAPPERFLAGS record.

Returns
pointer to the U_WMRSETMAPPERFLAGS record, or NULL on error.
Parameters
ModeIf 1 bit set font mapper selects only matching aspect fonts.
int U_WMRSETPALENTRIES_get ( const char *  contents,
U_PALETTE Palette,
const char **  PalEntries 
)

Get data from a U_WMRSETPALENTRIES record.

Returns
length of the U_WMRSETPALENTRIES record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
PaletteDefines a set of RGB values for the current active Palette.
PalEntriesArray of Palette Entries
char* U_WMRSETPALENTRIES_set ( const U_PALETTE Palette)

Allocate and construct a U_WMRSETPALENTRIES record.

Returns
pointer to the U_WMRSETPALENTRIES record, or NULL on error.
Parameters
PaletteDefines a set of RGB values for the current active Palette.
int U_WMRSETPIXEL_get ( const char *  contents,
U_COLORREF Color,
U_POINT16 Coord 
)

Get data from a U_WMRSETPIXEL record.

Returns
length of the U_WMRSETPIXEL record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
Colorpointer to a U_COLORREF variable where the color will be stored.
Coordpointer to a U_POINT16 variable where the coordinates will be stored.
char* U_WMRSETPIXEL_set ( U_COLORREF  Color,
U_POINT16  Coord 
)

Allocate and construct a U_WMRSETPIXEL record.

Returns
pointer to the U_WMRSETPIXEL record, or NULL on error.
Parameters
ColorU_COLORREF color of the pixel
CoordU_POINT16 coordinates of the pixel
int U_WMRSETPOLYFILLMODE_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETPOLYFILLMODE record.

Returns
length of the U_WMRSETPOLYFILLMODE record, or NULL on error
Parameters
contentsrecord to extract data from
ModePolyFillMode Enumeration
char* U_WMRSETPOLYFILLMODE_set ( uint16_t  Mode)

Create and return a U_WMRSETPOLYFILLMODE record.

Returns
pointer to the U_WMRSETPOLYFILLMODE record, or NULL on error
Parameters
ModePolyFillMode Enumeration
int U_WMRSETRELABS_get ( const char *  contents)

Get data from a U_WMRSETRELABS record.

Returns
length of the U_WMRSETRELABS record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
char* U_WMRSETRELABS_set ( void  )

Allocate and construct a U_WMRSETRELABS record.

Returns
pointer to the U_WMRSETRELABS record, or NULL on error.
int U_WMRSETROP2_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETROP2 record.

Returns
length of the U_WMRSETROP2 record, or NULL on error
Parameters
contentsrecord to extract data from
ModeBinary Raster Operation Enumeration
char* U_WMRSETROP2_set ( uint16_t  Mode)

Create and return a U_WMRSETROP2 record.

Returns
pointer to the U_WMRSETROP2 record, or NULL on error
Parameters
ModeBinary Raster Operation Enumeration
int U_WMRSETSTRETCHBLTMODE_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETSTRETCHBLTMODE record.

Returns
length of the U_WMRSETSTRETCHBLTMODE record, or NULL on error
Parameters
contentsrecord to extract data from
ModeStretchMode Enumeration
char* U_WMRSETSTRETCHBLTMODE_set ( uint16_t  Mode)

Create and return a U_WMRSETSTRETCHBLTMODE record.

Returns
pointer to the U_WMRSETSTRETCHBLTMODE record, or NULL on error
Parameters
ModeStretchMode Enumeration
int U_WMRSETTEXTALIGN_get ( const char *  contents,
uint16_t *  Mode 
)

Get data from a U_WMRSETTEXTALIGN record.

Returns
length of the U_WMRSETTEXTALIGN record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
ModeTextAlignment Enumeration.
char* U_WMRSETTEXTALIGN_set ( uint16_t  Mode)

Allocate and construct a U_WMRSETTEXTALIGN record.

Returns
pointer to the U_WMRSETTEXTALIGN record, or NULL on error.
Parameters
ModeTextAlignment Enumeration.
int U_WMRSETTEXTCHAREXTRA_get ( const char *  contents,
uint16_t *  Mode 
)

Retrieve values from a U_WMRSETTEXTCHAREXTRA record.

Returns
length of the U_WMRSETTEXTCHAREXTRA record, or NULL on error
Parameters
contentsrecord to extract data from
ModeExtra space in logical units to add to each character
char* U_WMRSETTEXTCHAREXTRA_set ( uint16_t  Mode)

Create and return a U_WMRSETTEXTCHAREXTRA record.

Returns
pointer to the U_WMRSETTEXTCHAREXTRA record, or NULL on error
Parameters
ModeExtra space in logical units to add to each character
int U_WMRSETTEXTCOLOR_get ( const char *  contents,
U_COLORREF Color 
)

Retrieve values from a U_WMRSETTEXTCOLOR record.

Returns
length of the U_WMRSETTEXTCOLOR record, or NULL on error
Parameters
contentsrecord to extract data from
ColorText Color.
char* U_WMRSETTEXTCOLOR_set ( U_COLORREF  Color)

Create and return a U_WMRSETTEXTCOLOR record.

Returns
pointer to the U_WMRSETTEXTCOLOR record, or NULL on error
Parameters
ColorText Color.
int U_WMRSETTEXTJUSTIFICATION_get ( const char *  contents,
uint16_t *  Count,
uint16_t *  Extra 
)

Retrieve values from a U_WMRSETTEXTJUSTIFICATION record.

Returns
length of the U_WMRSETTEXTJUSTIFICATION record, or NULL on error
Parameters
contentsrecord to extract data from
CountNumber of space characters in the line.
ExtraNumber of extra space characters to add to the line.
char* U_WMRSETTEXTJUSTIFICATION_set ( uint16_t  Count,
uint16_t  Extra 
)

Create and return a U_WMRSETTEXTJUSTIFICATION record.

Returns
pointer to the U_WMRSETTEXTJUSTIFICATION record, or NULL on error
Parameters
CountNumber of space characters in the line.
ExtraNumber of extra space characters to add to the line.
int U_WMRSETVIEWPORTEXT_get ( const char *  contents,
U_POINT16 extent 
)

Retrieve values from a U_WMRSETVIEWPORTEXT record.

Returns
length of the U_WMRSETVIEWPORTEXT record, or NULL on error
Parameters
contentsrecord to extract data from
extentViewport Extent.
char* U_WMRSETVIEWPORTEXT_set ( U_POINT16  extent)

Create and return a U_WMRSETVIEWPORTEXT record.

Returns
pointer to the U_WMRSETVIEWPORTEXT record, or NULL on error
Parameters
extentViewport Extent.
int U_WMRSETVIEWPORTORG_get ( const char *  contents,
U_POINT16 coord 
)

Retrieve values from a U_WMRSETVIEWPORTORG record.

Returns
length of the U_WMRSETVIEWPORTORG record, or NULL on error
Parameters
contentsrecord to extract data from
coordViewport Origin.
char* U_WMRSETVIEWPORTORG_set ( U_POINT16  coord)

Create and return a U_WMRSETVIEWPORTORG record.

Returns
pointer to the U_WMRSETVIEWPORTORG record, or NULL on error
Parameters
coordViewport Origin.
int U_WMRSETWINDOWEXT_get ( const char *  contents,
U_POINT16 extent 
)

Retrieve values from a U_WMRSETWINDOWEXT record.

Returns
length of the U_WMRSETWINDOWEXT record, or NULL on error
Parameters
contentsrecord to extract data from
extentWindow Extent.
char* U_WMRSETWINDOWEXT_set ( U_POINT16  extent)

Create and return a U_WMRSETWINDOWEXT record.

Returns
pointer to the U_WMRSETWINDOWEXT record, or NULL on error
Parameters
extentWindow Extent.
int U_WMRSETWINDOWORG_get ( const char *  contents,
U_POINT16 coord 
)

Retrieve values from a U_WMRSETWINDOWORG record.

Returns
length of the U_WMRSETWINDOWORG record, or NULL on error
Parameters
contentsrecord to extract data from
coordWindow Origin.
char* U_WMRSETWINDOWORG_set ( U_POINT16  coord)

Create and return a U_WMRSETWINDOWORG record.

Returns
pointer to the U_WMRSETWINDOWORG record, or NULL on error
Parameters
coordWindow Origin.
int U_WMRSTRETCHBLT_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cDst,
U_POINT16 Src,
U_POINT16 cSrc,
uint32_t *  dwRop3,
U_BITMAP16 Bm16,
const char **  px 
)

Get data from a U_WMRSTRETCHBLT record.

Returns
length of the U_WMRSTRETCHBLT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
dwRop3RasterOPeration Enumeration
Bm16bitmap16 object (fields in it are all 0 if no bitmap is used)
pxpointer to bitmap in memory, or NULL if not used
char* U_WMRSTRETCHBLT_set ( U_POINT16  Dst,
U_POINT16  cDst,
U_POINT16  Src,
U_POINT16  cSrc,
uint32_t  dwRop3,
const U_BITMAP16 Bm16 
)

Allocate and construct a U_WMRSTRETCHBLT record.

Returns
pointer to the U_WMRSTRETCHBLT record, or NULL on error.
Parameters
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
dwRop3RasterOPeration Enumeration
Bm16(Optional) bitmap16 object
int U_WMRSTRETCHDIB_get ( const char *  contents,
U_POINT16 Dst,
U_POINT16 cDst,
U_POINT16 Src,
U_POINT16 cSrc,
uint16_t *  cUsage,
uint32_t *  dwRop3,
const char **  dib 
)

Get data from a U_WMRSTRETCHDIB record.

Returns
length of the U_WMRSTRETCHDIB record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
cUsageDIBColors Enumeration
dwRop3RasterOPeration Enumeration
dib(Optional) device independent bitmap
char* U_WMRSTRETCHDIB_set ( U_POINT16  Dst,
U_POINT16  cDst,
U_POINT16  Src,
U_POINT16  cSrc,
uint16_t  cUsage,
uint32_t  dwRop3,
const U_BITMAPINFO Bmi,
uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_WMRSTRETCHDIB record.

Returns
pointer to the U_WMRSTRETCHDIB record, or NULL on error.
Parameters
DstDestination UL corner in logical units
cDstDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
cUsageDIBColors Enumeration
dwRop3RasterOPeration Enumeration
Bmi(Optional) bitmapbuffer (U_BITMAPINFO section)
cbPxSize in bytes of pixel array (row STRIDE * height, there may be some padding at the end of each row)
Px(Optional) bitmapbuffer (pixel array section )
int U_WMRTEXTOUT_get ( const char *  contents,
U_POINT16 Dst,
int16_t *  Length,
const char **  string 
)

Get data from a U_WMRTEXTOUT record.

Returns
length of the U_WMRTEXTOUT record in bytes, or 0 on error
Parameters
contentsrecord to extract data from
Dstcoordinates where text will be written
LengthNumber of characters in string.
stringPointer to string in WMF buffer in memory. This text is generally NOT null terminated!!!
char* U_WMRTEXTOUT_set ( U_POINT16  Dst,
char *  string 
)

Allocate and construct a U_WMRTEXTOUT record.

Returns
pointer to the U_WMRTEXTOUT record, or NULL on error.
Parameters
DstDestinationin logical units
stringNull terminated string to write. The terminator is NOT placed in the record!
char* wbegin_path_set ( void  )

Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly.

Returns
pointer to the U_WMRESCAPE structure, or NULL on error.
char* wcreatebrushindirect_set ( uint32_t *  ihBrush,
WMFHANDLES wht,
U_WLOGBRUSH  lb 
)

Allocate and construct a U_WMRCREATEBRUSHINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEBRUSHINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRCREATEBRUSHINDIRECT record, or NULL on error.
Parameters
ihBrushhandle to be used by new object
whtWMF handle table
lbBrush parameters
char* wcreatedibpatternbrush_srcbm16_set ( uint32_t *  ihBrush,
WMFHANDLES wht,
const uint32_t  iUsage,
const U_BITMAP16 Bm16 
)

Allocate and construct a U_WMRCREATEPATTERNBRUSH record from a U_BITMAP16 object. Use this function instead of calling U_WMRCREATEPATTERNBRUSH_set() directly.

Returns
pointer to the U_WMRCREATEPATTERNBRUSH record, or NULL on error.
Parameters
ihBrushhandle to be used by new object
whtWMF handle table
iUsageDIBColors enumeration
Bm16Pointer to a Bitmap16 object
char* wcreatedibpatternbrush_srcdib_set ( uint32_t *  ihBrush,
WMFHANDLES wht,
const uint32_t  iUsage,
const U_BITMAPINFO Bmi,
const uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_WMRDIBCREATEPATTERNBRUSH record from a DIB. Use this function instead of calling U_WMRDIBCREATEPATTERNBRUSH_set() directly.

Returns
pointer to the U_WMRDIBCREATEPATTERNBRUSH record, or NULL on error.
Parameters
ihBrushhandle to be used by new object
whtWMF handle table
iUsageDIBColors enumeration
BmiBitmap info
cbPxSize in bytes of pixel array (row stride * height, there may be some padding at the end of each row)
Px(Optional) bitmapbuffer (pixel array section )
char* wcreatefontindirect_set ( uint32_t *  ihFont,
WMFHANDLES wht,
U_FONT uf 
)

Allocate and construct a U_WMRCREATEFONTINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEFONTINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRCREATEFONTINDIRECT record, or NULL on error.
Parameters
ihFontFont handle, will be created and returned
whtPointer to structure holding all WMF handles
ufPointer to Font parameters as U_FONT *
char* wcreatepalette_set ( uint32_t *  ihPal,
WMFHANDLES wht,
U_PALETTE up 
)

Allocate and construct a U_WMRCREATEPALETTE record, create a handle and returns it Use this function instead of calling U_WMRCREATEPALETTE_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRCREATEPALETTE record, or NULL on error.
Parameters
ihPalPalette handle, will be created and returned
whtPointer to structure holding all WMF handles
upPalette parameters
char* wcreatepatternbrush_set ( uint32_t *  ihBrush,
WMFHANDLES wht,
U_BITMAP16 Bm16,
char *  Pattern 
)

Allocate and construct a U_WMRCREATEPATTERNBRUSH record, create a handle and returns it Use this function instead of calling U_WMRCREATEPATTERNBRUSH_set() directly. Warning - application support for U_WMRCREATEPATTERNBRUSH is spotty, better to use U_WMRDIBCREATEPATTERNBRUSH.

Returns
pointer to the U_WMRCREATEPATTERNBRUSH record, or NULL on error.
Parameters
ihBrushhandle to be used by new object
whtWMF handle table
Bm16Pointer to a Bitmap16 structure (only first 10 bytes are used).
PatternPointer to a byte array described by Bm16. (Pattern may be a pointer to the BM16 Bits field.)
char* wcreatepenindirect_set ( uint32_t *  ihPen,
WMFHANDLES wht,
U_PEN  pen 
)

Allocate and construct a U_WMRCREATEPENINDIRECT record, create a handle and returns it Use this function instead of calling U_WMRCREATEPENINDIRECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRCREATEPENINDIRECT record, or NULL on error.
Parameters
ihPenhandle to be used by new object
whtWMF handle table
penPen parameters (U_PEN)
char* wcreateregion_set ( uint32_t *  ihReg,
WMFHANDLES wht,
const U_REGION Region 
)

Allocate and construct a U_WMRCREATEREGION record, create a handle and returns it Use this function instead of calling U_WMRCREATEREGION() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_REGIONS record, or NULL on error.
Parameters
ihRegRegion handle, will be created and returned
whtPointer to structure holding all WMF handles
RegionValues to set with
char* wdeleteobject_set ( uint32_t *  ihObject,
WMFHANDLES wht 
)

Allocate and construct a U_WMRDELETEOBJECT record and also delete the requested object from the table. Use this function instead of calling U_WMRDELETEOBJECT_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRDELETEOBJECT record, or NULL on error.
Parameters
ihObjectPointer to handle to delete. This value is set to 0xFFFFFFFF if the function succeeds.
whtWMF handle table

Note that calling this function should always be conditional on the specifed object being defined. It is easy to write a program where deleteobject_set() is called in a sequence where, at the time, we know that ihObject is defined. Then a later modification, possibly quite far away in the code, causes it to be undefined. That distant change will result in a failure when this function reutrns. That problem cannot be handled here because the only values which may be returned are a valid U_WMRDELETEOBJECT record or a NULL, and other errors could result in the NULL. So the object must be checked before the call.

char* wend_path_set ( void  )

Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly.

Returns
pointer to the U_WMRESCAPE structure, or NULL on error.
int wget_DIB_params ( const char *  dib,
const char **  px,
const U_RGBQUAD **  ct,
int32_t *  numCt,
int32_t *  width,
int32_t *  height,
int32_t *  colortype,
int32_t *  invert 
)

Assume a packed DIB and get the parameters from it, use by DBI_to_RGBA()

Returns
BI_Compression Enumeration. For anything other than U_BI_RGB values other than px may not be valid.
Parameters
dibpointer to the start of the DIB in the record
pxpointer to DIB pixel array
ctpointer to DIB color table
numCtDIB color table number of entries, for PNG or JPG returns the number of bytes in the image
widthWidth of pixel array
heightHeight of pixel array (always returned as a positive number)
colortypeDIB BitCount Enumeration
invertIf DIB rows are in opposite order from RGBA rows
char* wlinecap_set ( int32_t  Type)

Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly.

Returns
pointer to the U_WMRESCAPE structure, or NULL on error.
Parameters
TypePostScriptCap Enumeration, anything else is an error
char* wlinejoin_set ( int32_t  Type)

Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly.

Returns
pointer to the U_WMRESCAPE structure, or NULL on error.
Parameters
TypePostScriptCap Enumeration, anything else is an error
int wmf_append ( U_METARECORD rec,
WMFTRACK wt,
int  freerec 
)

Append an WMF record to a wmf in memory. This may reallocate buf memory.

Returns
0 for success, >=1 for failure.
Parameters
recRecord to append to WMF in memory
wtWMF in memory
freerecIf true, free rec after append
int wmf_finish ( WMFTRACK wt)

Finalize the emf in memory and write it to the file.

Returns
0 on success, >=1 on failure
Parameters
wtWMF in memory
int wmf_free ( WMFTRACK **  wt)

Release memory for an wmf structure in memory. Call this after wmf_finish().

Returns
0 on success, >=1 on failure
Parameters
wtWMF in memory
int wmf_header_append ( U_METARECORD rec,
WMFTRACK wt,
int  freerec 
)

Append an WMF header to a wmf in memory. This may reallocate buf memory. WMF header is not a normal record, method used to figure out its size is different.

Returns
0 for success, >=1 for failure.
Parameters
recheader to append to WMF in memory
wtWMF in memory
freerecIf true, free rec after append
int wmf_htable_create ( uint32_t  initsize,
uint32_t  chunksize,
WMFHANDLES **  wht 
)

Create a handle table. Entries filled with 0 are empty, entries >0 hold a handle.

Returns
0 for success, >=1 for failure.
Parameters
initsizeInitialize with space for this number of handles
chunksizeWhen needed increase space by this number of handles
whtWMF handle table
int wmf_htable_delete ( uint32_t *  ih,
WMFHANDLES wht 
)

Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with a 0.

Returns
0 for success, >=1 for failure.
Parameters
ihhandle
whtWMF handle table
int wmf_htable_free ( WMFHANDLES **  wht)

Free all memory in an htable. Sets the pointer to NULL.

Returns
0 for success, >=1 for failure.
Parameters
whtWMF handle table
int wmf_htable_insert ( uint32_t *  ih,
WMFHANDLES wht 
)

Returns the index of the first free slot. Call realloc() if needed. The slot is set to handle (indicates occupied) and the peak value is adjusted.

Returns
0 for success, >=1 for failure.
Parameters
ihhandle
whtWMF handle table
int wmf_readdata ( const char *  filename,
char **  contents,
size_t *  length 
)

Retrieve contents of an WMF file by name.

Returns
0 on success, >=1 on failure
Parameters
filenameName of file to open, including the path
contentsContents of the file. Buffer must be free()'d by caller.
lengthNumber of bytes in Contents
int wmf_start ( const char *  name,
const uint32_t  initsize,
const uint32_t  chunksize,
WMFTRACK **  wt 
)

Start constructing an wmf in memory. Supply the file name and initial size.

Returns
0 for success, >=0 for failure.
Parameters
nameWMF filename (will be opened)
initsizeInitialize WMF in memory to hold this many bytes
chunksizeWhen needed increase WMF in memory by this number of bytes
wtWMF in memory
int wmfheader_get ( const char *  contents,
const char *  blimit,
U_WMRPLACEABLE Placeable,
U_WMRHEADER Header 
)

Get data from a (placeable) WMR_HEADER.

Returns
size of the record in bytes, 0 on failure
Parameters
contentsrecord to extract data from
blimitone byte past the last WMF record in memory.
PlaceableU_WMRPLACEABLE data, if any
HeaderU_WMRHEADER data, if any
char* wmiterlimit_set ( int32_t  limit)

Allocate and construct the specified U_WMRESCAPE structure, create a handle and returns it Use this function instead of calling U_WMRESCAPE_set() directly.

Returns
pointer to the U_WMRESCAPE structure, or NULL on error.
Parameters
limitPostScriptCap Enumeration, anything else is an error
int wmr_arc_points ( U_RECT16  rclBox16,
U_POINT16  ArcStart16,
U_POINT16  ArcEnd16,
int *  f1,
int  f2,
U_PAIRF center,
U_PAIRF start,
U_PAIRF end,
U_PAIRF size 
)

Derive from bounding box and start and end arc, for WMF arc, chord, or pie records, the center, start, and end points, and the bounding rectangle.

Returns
0 on success, other values on errors.
Parameters
rclBox16Bounding box of Arc
ArcStart16Coordinates for Start of Arc
ArcEnd16Coordinates for End of Arc
f11 if rotation angle >= 180, else 0
f2Rotation direction, 1 if counter clockwise, else 0
centerCenter coordinates
startStart coordinates (point on the ellipse defined by rect)
endEnd coordinates (point on the ellipse defined by rect)
sizeW,H of the x,y axes of the bounding rectangle.
char* wmr_dup ( const char *  wmr)

Duplicate an WMR record.

Parameters
wmrrecord to duplicate
char* wselectobject_set ( uint32_t  ihObject,
WMFHANDLES wht 
)

Allocate and construct a U_WMRSELECTOBJECT record, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_WMRSELECTOBJECT_set() directly. Object Pointer in WMF (caller) is 0->N, so is record, so no correction to 1->N+1 needed here.

Returns
pointer to the U_WMRSELECTOBJECT record, or NULL on error.
Parameters
ihObjecthandle to select
whtWMF handle table
char* wsetpaletteentries_set ( uint32_t *  ihPal,
WMFHANDLES wht,
const U_PALETTE Palettes 
)

Allocate and construct a U_WMRSETPALENTRIES record, create a handle and returns it Use this function instead of calling U_WMRSETPALENTRIES_set() directly. Object Pointer in WMF (caller) is 0->N, but in htable it is 1->N+1, make that correction here.

Returns
pointer to the U_WMRSETPALENTRIES record, or NULL on error.
Parameters
ihPalPalette handle, will be created and returned
whtPointer to structure holding all WMF handles
PalettesValues to set with