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

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

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

Functions

char * U_emr_names (unsigned int idx)
 Look up the name of the EMR record by type. Returns U_EMR_INVALID if out of range. More...
 
int memprobe (const void *buf, size_t size)
 Debugging utility, used with valgrind to find uninitialized values. Not for use in production code. More...
 
void dumpeht (char *string, unsigned int *handle, EMFHANDLES *eht)
 Dump an EMFHANDLES structure. Not for use in production code. More...
 
uint32_t * dx_set (int32_t height, uint32_t weight, uint32_t members)
 Make up an approximate dx array to pass to emrtext_set(), based on character height and weight. More...
 
uint32_t emr_properties (uint32_t type)
 Look up the properties (a bit map) of a type of EMR record. Bits that may be set are defined in "Draw Properties" in uemf.h, they are U_DRAW_NOTEMPTY, etc.. More...
 
int emr_arc_points_common (PU_RECTL rclBox, PU_POINTL ArcStart, PU_POINTL ArcEnd, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size)
 Derive from bounding rect, start and end radials, for arc, chord, or pie, the center, start, and end points, and the bounding rectangle. More...
 
int emr_arc_points (PU_ENHMETARECORD record, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size)
 Derive from an EMF arc, chord, or pie the center, start, and end points, and the bounding rectangle. More...
 
int RGBA_to_DIB (char **px, uint32_t *cbPx, PU_RGBQUAD *ct, int *numCt, const char *rgba_px, int w, int h, int stride, uint32_t colortype, int use_ct, int invert)
 Convert a U_RGBA 32 bit pixmap to one of many different types of DIB pixmaps. More...
 
int get_real_color_count (const char *Bmih)
 Get the actual number of colors in the color table from the BitMapInfoHeader. More...
 
int get_real_color_icount (int Colors, int BitCount, int Width, int Height)
 Get the actual number of colors in the color table from the ClrUsed, BitCount, Width, and Height. More...
 
int get_DIB_params (void *pEmr, uint32_t offBitsSrc, uint32_t offBmiSrc, const char **px, const U_RGBQUAD **ct, uint32_t *numCt, uint32_t *width, uint32_t *height, uint32_t *colortype, uint32_t *invert)
 Get the DIB parameters from the BMI of the record for use by DBI_to_RGBA() More...
 
int DIB_to_RGBA (const char *px, const U_RGBQUAD *ct, int numCt, char **rgba_px, int w, int h, uint32_t colortype, int use_ct, int invert)
 Convert one of many different types of DIB pixmaps to an RGBA 32 bit pixmap. More...
 
char * RGBA_to_RGBA (char *rgba_px, int w, int h, int sl, int st, int *eew, int *eeh)
 Extract a subset of an RGBA bitmap array. Frees the incoming bitmap array IF a subset is extracted, otherwise it is left alone. If the entire array is extracted it just returns the incoming pointer. If the subset requested is partially outside of the bitmap the region is clipped to the bitmap boundaries and extracted. This seems to be a (very) grey area in EMF files, and even different Microsoft applications do not always do the same thing. For instance, XP Preview gives some different images for EMR_BITBLT records than does the "import image" (but not unpacked) view in PowerPoint. Since all of these states are probably best viewed as undefined or errors we can only try to do something reasonable and not blow up when encountering one. More...
 
char * emr_dup (const char *emr)
 Duplicate an EMR record. More...
 
int emf_start (const char *name, const uint32_t initsize, const uint32_t chunksize, EMFTRACK **et)
 Start constructing an emf in memory. Supply the file name and initial size. More...
 
int emf_finish (EMFTRACK *et, EMFHANDLES *eht)
 Finalize the emf in memory and write it to the file. More...
 
int emf_free (EMFTRACK **et)
 Release memory for an emf structure in memory. Call this after emf_finish(). More...
 
FILE * emf_fopen (const char *filename, const int mode)
 wrapper for fopen, works on any platform More...
 
int emf_readdata (const char *filename, char **contents, size_t *length)
 Retrieve contents of an EMF file by name. More...
 
int emf_append (U_ENHMETARECORD *rec, EMFTRACK *et, int freerec)
 Append an EMF record to an emf in memory. This may reallocate buf memory. More...
 
int emf_htable_create (uint32_t initsize, uint32_t chunksize, EMFHANDLES **eht)
 Create a handle table. Entries filled with 0 are empty, entries >0 hold a handle. More...
 
int emf_htable_delete (uint32_t *ih, EMFHANDLES *eht)
 Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with a 0. More...
 
int emf_htable_insert (uint32_t *ih, EMFHANDLES *eht)
 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 emf_htable_free (EMFHANDLES **eht)
 Free all memory in an htable. Sets the pointer to NULL. More...
 
int device_size (const int xmm, const int ymm, const float dpmm, U_SIZEL *szlDev, U_SIZEL *szlMm)
 Set up fields for an EMR_HEADER from the physical device's width and height in mm and dots per millimeter. Typically this is something like 216,279,47.244 (Letter paper, 1200 DPI = 47.244 DPmm) More...
 
int drawing_size (const int xmm, const int ymm, const float dpmm, U_RECTL *rclBounds, U_RECTL *rclFrame)
 Set up fields for an EMR_HEADER for drawing by physical size in mm and dots per millimeter. Technically rclBounds is supposed to be the extent of the drawing within the EMF, but libUEMF has no way of knowing this since it never actually draws anything. Instead this is set to the full drawing size. Coordinates are inclusive inclusive, so 297 -> 0,29699. More...
 
U_COLORREF colorref3_set (uint8_t red, uint8_t green, uint8_t blue)
 Set a U_COLORREF value from separate R,G,B values. More...
 
U_COLORREF colorref4_set (uint8_t red, uint8_t green, uint8_t blue, uint8_t Reserved)
 Set a U_COLORREF value from separate R,G,B, and Reserved values. More...
 
U_RGBQUAD rgbquad_set (uint8_t red, uint8_t green, uint8_t blue, uint8_t reserved)
 Set a U_RGBQUAD value from separate R,G,B, Reserved values. More...
 
U_RECTL rectl_set (U_POINTL ul, U_POINTL lr)
 Set rect and rectl objects from Upper Left and Lower Right corner points. More...
 
U_SIZEL sizel_set (int32_t x, int32_t y)
 Set sizel objects with X,Y values. More...
 
U_POINTL point32_set (int32_t x, int32_t y)
 Set pointl objects with X,Y values. More...
 
U_POINT16 point16_set (int16_t x, int16_t y)
 Set point16 objects with 16 bit X,Y values. More...
 
U_RECT findbounds (uint32_t count, PU_POINT pts, uint32_t width)
 Find the bounding rectangle from a polyline of a given width. More...
 
U_RECT findbounds16 (uint32_t count, PU_POINT16 pts, uint32_t width)
 Find the bounding rectangle from a polyline of a given width. More...
 
U_LOGBRUSH logbrush_set (uint32_t lbStyle, U_COLORREF lbColor, int32_t lbHatch)
 Construct a U_LOGBRUSH structure. More...
 
U_XFORM xform_set (U_FLOAT eM11, U_FLOAT eM12, U_FLOAT eM21, U_FLOAT eM22, U_FLOAT eDx, U_FLOAT eDy)
 Construct a U_XFORM structure. More...
 
U_XFORM xform_alt_set (U_FLOAT scale, U_FLOAT ratio, U_FLOAT rot, U_FLOAT axisrot, U_FLOAT eDx, U_FLOAT eDy)
 Construct a U_XFORM structure. More...
 
U_LOGCOLORSPACEA logcolorspacea_set (int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, char *lcsFilename)
 Construct a U_LOGCOLORSPACEA structure. More...
 
U_LOGCOLORSPACEW logcolorspacew_set (int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, uint16_t *lcsFilename)
 Construct a U_LOGCOLORSPACEW structure. More...
 
U_PANOSE panose_set (uint8_t bFamilyType, uint8_t bSerifStyle, uint8_t bWeight, uint8_t bProportion, uint8_t bContrast, uint8_t bStrokeVariation, uint8_t bArmStyle, uint8_t bLetterform, uint8_t bMidline, uint8_t bXHeight)
 Construct a U_PANOSE structure. More...
 
U_LOGFONT logfont_set (int32_t lfHeight, int32_t lfWidth, int32_t lfEscapement, int32_t lfOrientation, int32_t lfWeight, uint8_t lfItalic, uint8_t lfUnderline, uint8_t lfStrikeOut, uint8_t lfCharSet, uint8_t lfOutPrecision, uint8_t lfClipPrecision, uint8_t lfQuality, uint8_t lfPitchAndFamily, uint16_t *lfFaceName)
 Construct a U_LOGFONT structure. More...
 
U_LOGFONT_PANOSE logfont_panose_set (U_LOGFONT elfLogFont, uint16_t *elfFullName, uint16_t *elfStyle, uint32_t elfStyleSize, U_PANOSE elfPanose)
 Construct a U_LOGFONT_PANOSE structure. More...
 
U_BITMAPINFOHEADER bitmapinfoheader_set (int32_t biWidth, int32_t biHeight, uint16_t biPlanes, uint16_t biBitCount, uint32_t biCompression, uint32_t biSizeImage, int32_t biXPelsPerMeter, int32_t biYPelsPerMeter, U_NUM_RGBQUAD biClrUsed, uint32_t biClrImportant)
 Construct a U_BITMAPINFOHEADER structure. More...
 
PU_BITMAPINFO bitmapinfo_set (U_BITMAPINFOHEADER BmiHeader, PU_RGBQUAD BmiColors)
 Allocate and construct a U_BITMAPINFO structure. More...
 
PU_EXTLOGPEN extlogpen_set (uint32_t elpPenStyle, uint32_t elpWidth, uint32_t elpBrushStyle, U_COLORREF elpColor, int32_t elpHatch, U_NUM_STYLEENTRY elpNumEntries, U_STYLEENTRY *elpStyleEntry)
 Allocate and construct a U_EXTLOGPEN structure. More...
 
U_LOGPEN logpen_set (uint32_t lopnStyle, U_POINT lopnWidth, U_COLORREF lopnColor)
 Construct a U_LOGPEN structure. More...
 
U_LOGPLTNTRY logpltntry_set (uint8_t peReserved, uint8_t peRed, uint8_t peGreen, uint8_t peBlue)
 Construct a U_LOGPLTNTRY structure. More...
 
PU_LOGPALETTE logpalette_set (U_NUM_LOGPLTNTRY palNumEntries, PU_LOGPLTNTRY *palPalEntry)
 Allocate and construct a U_LOGPALETTE structure. More...
 
U_RGNDATAHEADER rgndataheader_set (U_NUM_RECTL nCount, U_RECTL rclBounds)
 Construct a U_RGNDATAHEADER structure. More...
 
PU_RGNDATA rgndata_set (U_RGNDATAHEADER rdh, PU_RECTL Buffer)
 Allocate and construct a U_RGNDATA structure. More...
 
U_COLORADJUSTMENT coloradjustment_set (uint16_t Size, uint16_t Flags, uint16_t IlluminantIndex, uint16_t RedGamma, uint16_t GreenGamma, uint16_t BlueGamma, uint16_t ReferenceBlack, uint16_t ReferenceWhite, int16_t Contrast, int16_t Brightness, int16_t Colorfulness, int16_t RedGreenTint)
 Construct a U_COLORADJUSTMENT structure. More...
 
U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set (uint32_t dwFlags, uint8_t iPixelType, uint8_t cColorBits, uint8_t cRedBits, uint8_t cRedShift, uint8_t cGreenBits, uint8_t cGreenShift, uint8_t cBlueBits, uint8_t cBlueShift, uint8_t cAlphaBits, uint8_t cAlphaShift, uint8_t cAccumBits, uint8_t cAccumRedBits, uint8_t cAccumGreenBits, uint8_t cAccumBlueBits, uint8_t cAccumAlphaBits, uint8_t cDepthBits, uint8_t cStencilBits, uint8_t cAuxBuffers, uint8_t iLayerType, uint8_t bReserved, uint32_t dwLayerMask, uint32_t dwVisibleMask, uint32_t dwDamageMask)
 Construct a U_PIXELFORMATDESCRIPTOR structure. More...
 
char * emrtext_set (U_POINTL ptlReference, U_NUM_STR NumString, uint32_t cbChar, void *String, uint32_t fOptions, U_RECTL rcl, uint32_t *Dx)
 Allocate and create a U_EMRTEXT structure followed by its variable pieces via a char* pointer. Dx cannot be NULL, if the calling program has no appropriate values call dx_set() first. More...
 
char * textcomment_set (const char *string)
 Allocate and construct a U_EMRCOMMENT structure with a UTF8 string. A U_EMRCOMMENT contains application specific data, and that may include contain null characters. This function may be used when the comment only incluces UT8 text. More...
 
char * deleteobject_set (uint32_t *ihObject, EMFHANDLES *eht)
 Allocate and construct a U_EMRDELETEOBJECT structure and also delete the requested object from the table. Use this function instead of calling U_EMRDELETEOBJECT_set() directly. More...
 
char * selectobject_set (uint32_t ihObject, EMFHANDLES *eht)
 Allocate and construct a U_EMRSELECTOBJECT structure, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_EMRSELECTOBJECT_set() directly. More...
 
char * extcreatepen_set (uint32_t *ihPen, EMFHANDLES *eht, PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, PU_EXTLOGPEN elp)
 Allocate and construct a U_EMREXTCREATEPEN structure, create a handle and return it. Use this function instead of calling U_EMREXTCREATEPEN_set() directly. More...
 
char * createpen_set (uint32_t *ihPen, EMFHANDLES *eht, U_LOGPEN lopn)
 Allocate and construct a U_EMRCREATEPEN structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPEN_set() directly. More...
 
char * createbrushindirect_set (uint32_t *ihBrush, EMFHANDLES *eht, U_LOGBRUSH lb)
 Allocate and construct a U_EMRCREATEBRUSHINDIRECT structure, create a handle and returns it Use this function instead of calling U_EMRCREATEBRUSHINDIRECT_set() directly. More...
 
char * createdibpatternbrushpt_set (uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
 Allocate and construct a U_EMRCREATEDIBPATTERNBRUSHPT_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEDIBPATTERNBRUSHPT_set() directly. More...
 
char * createmonobrush_set (uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
 Allocate and construct a U_EMRCREATEMONOBRUSH_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEMONOBRUSH_set() directly. More...
 
char * createcolorspace_set (uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEA lcs)
 Allocate and construct a U_EMRCREATECOLORSPACE structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACE_set() directly. More...
 
char * createcolorspacew_set (uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEW lcs, uint32_t dwFlags, U_CBDATA cbData, uint8_t *Data)
 Allocate and construct a U_EMRCREATECOLORSPACEW structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACEW_set() directly. More...
 
char * extcreatefontindirectw_set (uint32_t *ihFont, EMFHANDLES *eht, const char *elf, const char *elfw)
 Allocate and construct a U_EMREXTCREATEFONTINDIRECTW structure, create a handle and returns it Use this function instead of calling U_EMREXTCREATEFONTINDIRECTW_set() directly. More...
 
char * createpalette_set (uint32_t *ihPal, EMFHANDLES *eht, U_LOGPALETTE lgpl)
 Allocate and construct a U_EMRCREATEPALETTE structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPALETTE_set() directly. More...
 
char * setpaletteentries_set (uint32_t *ihPal, EMFHANDLES *eht, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries)
 Allocate and construct a U_EMRSETPALETTEENTRIES structure, create a handle and returns it Use this function instead of calling U_EMRSETPALETTEENTRIES_set() directly. More...
 
char * fillrgn_set (uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const PU_RGNDATA RgnData)
 Allocate and construct a U_EMRFILLRGN structure, create a handle and returns it Use this function instead of calling U_EMRFILLRGN_set() directly. More...
 
char * framergn_set (uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const U_SIZEL szlStroke, const PU_RGNDATA RgnData)
 Allocate and construct a U_EMRFRAMERGN structure, create a handle and returns it Use this function instead of calling U_EMRFRAMERGN_set() directly. More...
 
PU_POINT points_transform (PU_POINT points, int count, U_XFORM xform)
 Allocate and construct an array of U_POINT objects which has been subjected to a U_XFORM. More...
 
PU_POINT16 point16_transform (PU_POINT16 points, int count, U_XFORM xform)
 Allocate and construct an array of U_POINT16 objects which has been subjected to a U_XFORM. More...
 
PU_TRIVERTEX trivertex_transform (PU_TRIVERTEX tv, int count, U_XFORM xform)
 Allocate and construct an array of U_TRIVERTEX objects which has been subjected to a U_XFORM. More...
 
PU_POINT point16_to_point (PU_POINT16 points, int count)
 Allocate and construct an array of U_POINT objects from a set of U_POINT16 objects. More...
 
PU_POINT16 point_to_point16 (PU_POINT points, int count)
 Allocate and construct an array of U_POINT16 objects from a set of U_POINT objects. More...
 
char * U_EMRHEADER_set (const U_RECTL rclBounds, const U_RECTL rclFrame, U_PIXELFORMATDESCRIPTOR *const pfmtDesc, U_CBSTR nDesc, uint16_t *const Description, const U_SIZEL szlDevice, const U_SIZEL szlMillimeters, const uint32_t bOpenGL)
 Allocate and construct a U_EMRHEADER record. More...
 
char * U_EMRPOLYBEZIER_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYBEZIER record. More...
 
char * U_EMRPOLYGON_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYGON record. More...
 
char * U_EMRPOLYLINE_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYLINE record. More...
 
char * U_EMRPOLYBEZIERTO_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYBEZIERTO record. More...
 
char * U_EMRPOLYLINETO_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYLINETO record. More...
 
char * U_EMRPOLYPOLYLINE_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYPOLYLINE record. More...
 
char * U_EMRPOLYPOLYGON_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points)
 Allocate and construct a U_EMR_POLYPOLYGON record. More...
 
char * U_EMRSETWINDOWEXTEX_set (const U_SIZEL szlExtent)
 Allocate and construct a U_EMR_SETWINDOWEXTEX record. More...
 
char * U_EMRSETWINDOWORGEX_set (const U_POINTL ptlOrigin)
 Allocate and construct a U_EMR_SETWINDOWORGEX record. More...
 
char * U_EMRSETVIEWPORTEXTEX_set (const U_SIZEL szlExtent)
 Allocate and construct a U_EMR_SETVIEWPORTEXTEX record. More...
 
char * U_EMRSETVIEWPORTORGEX_set (const U_POINTL ptlOrigin)
 Allocate and construct a U_EMR_SETVIEWPORTORGEX record. More...
 
char * U_EMRSETBRUSHORGEX_set (const U_POINTL ptlOrigin)
 Allocate and construct a U_EMR_SETBRUSHORGEX record. More...
 
char * U_EMREOF_set (const U_CBPLENTRIES cbPalEntries, const PU_LOGPLTNTRY PalEntries, EMFTRACK *et)
 Allocate and construct a U_EMR_EOF record. More...
 
char * U_EMRSETPIXELV_set (const U_POINTL ptlPixel, const U_COLORREF crColor)
 Allocate and construct a U_EMR_SETPIXELV record. More...
 
char * U_EMRSETMAPPERFLAGS_set (void)
 Allocate and construct a U_EMR_SETMAPPERFLAGS record. More...
 
char * U_EMRSETMAPMODE_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETMAPMODE record. More...
 
char * U_EMRSETBKMODE_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETBKMODE record. More...
 
char * U_EMRSETPOLYFILLMODE_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETPOLYFILLMODE record. More...
 
char * U_EMRSETROP2_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETROP2 record. More...
 
char * U_EMRSETSTRETCHBLTMODE_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETSTRETCHBLTMODE record. More...
 
char * U_EMRSETTEXTALIGN_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETTEXTALIGN record. More...
 
char * U_EMRSETCOLORADJUSTMENT_set (const U_COLORADJUSTMENT ColorAdjustment)
 Allocate and construct a U_EMR_SETCOLORADJUSTMENT record. More...
 
char * U_EMRSETTEXTCOLOR_set (const U_COLORREF crColor)
 Allocate and construct a U_EMR_SETTEXTCOLOR record. More...
 
char * U_EMRSETBKCOLOR_set (const U_COLORREF crColor)
 Allocate and construct a U_EMR_SETBKCOLOR record. More...
 
char * U_EMROFFSETCLIPRGN_set (const U_POINTL ptl)
 Allocate and construct a U_EMR_OFFSETCLIPRGN record. More...
 
char * U_EMRMOVETOEX_set (const U_POINTL ptl)
 Allocate and construct a U_EMR_MOVETOEX record. More...
 
char * U_EMRSETMETARGN_set (void)
 Allocate and construct a U_EMR_SETMETARGN record. More...
 
char * U_EMREXCLUDECLIPRECT_set (const U_RECTL rclClip)
 Allocate and construct a U_EMR_EXCLUDECLIPRECT record. More...
 
char * U_EMRINTERSECTCLIPRECT_set (const U_RECTL rclClip)
 Allocate and construct a U_EMR_INTERSECTCLIPRECT record. More...
 
char * U_EMRSCALEVIEWPORTEXTEX_set (const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom)
 Allocate and construct a U_EMR_SCALEVIEWPORTEXTEX record. More...
 
char * U_EMRSCALEWINDOWEXTEX_set (const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom)
 Allocate and construct a U_EMR_SCALEWINDOWEXTEX record. More...
 
char * U_EMRSAVEDC_set (void)
 Allocate and construct a U_EMR_SAVEDC record. More...
 
char * U_EMRRESTOREDC_set (const int32_t iRelative)
 Allocate and construct a U_EMR_RESTOREDC record. More...
 
char * U_EMRSETWORLDTRANSFORM_set (const U_XFORM xform)
 Allocate and construct a U_EMR_SETWORLDTRANSFORM record. More...
 
char * U_EMRMODIFYWORLDTRANSFORM_set (const U_XFORM xform, const uint32_t iMode)
 Allocate and construct a U_EMR_MODIFYWORLDTRANSFORM record. More...
 
char * U_EMRSELECTOBJECT_set (const uint32_t ihObject)
 Allocate and construct a U_EMR_SELECTOBJECT record. Use selectobject_set() instead of calling this function directly. More...
 
char * U_EMRCREATEPEN_set (const uint32_t ihPen, const U_LOGPEN lopn)
 Allocate and construct a U_EMR_CREATEPEN record. Use createpen_set() instead of calling this function directly. More...
 
char * U_EMRCREATEBRUSHINDIRECT_set (const uint32_t ihBrush, const U_LOGBRUSH lb)
 Allocate and construct a U_EMR_CREATEBRUSHINDIRECT record. Use createbrushindirect_set() instead of calling this function directly. More...
 
char * U_EMRDELETEOBJECT_set (const uint32_t ihObject)
 Allocate and construct a U_EMR_DELETEOBJECT record. Use deleteobject_set() instead of calling this function directly. More...
 
char * U_EMRANGLEARC_set (const U_POINTL ptlCenter, const uint32_t nRadius, const U_FLOAT eStartAngle, const U_FLOAT eSweepAngle)
 Allocate and construct a U_EMR_ANGLEARC record. More...
 
char * U_EMRELLIPSE_set (const U_RECTL rclBox)
 Allocate and construct a U_EMR_ELLIPSE record. More...
 
char * U_EMRRECTANGLE_set (const U_RECTL rclBox)
 Allocate and construct a U_EMR_RECTANGLE record. More...
 
char * U_EMRROUNDRECT_set (const U_RECTL rclBox, const U_SIZEL szlCorner)
 Allocate and construct a U_EMR_ROUNDRECT record. More...
 
char * U_EMRARC_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
 Allocate and construct a U_EMR_ARC record. More...
 
char * U_EMRCHORD_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
 Allocate and construct a U_EMR_CHORD record. More...
 
char * U_EMRPIE_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd)
 Allocate and construct a U_EMR_PIE record. More...
 
char * U_EMRSELECTPALETTE_set (const uint32_t ihPal)
 Allocate and construct a U_EMR_SELECTPALETTE record. More...
 
char * U_EMRCREATEPALETTE_set (const uint32_t ihPal, const U_LOGPALETTE lgpl)
 Allocate and construct a U_EMR_CREATEPALETTE record. Use createpalette_set() instead of calling this function directly. More...
 
char * U_EMRSETPALETTEENTRIES_set (const uint32_t ihPal, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries)
 Allocate and construct a U_EMR_SETPALETTEENTRIES record. Use setpaletteentries_set() instead of calling this function directly. More...
 
char * U_EMRRESIZEPALETTE_set (const uint32_t ihPal, const uint32_t cEntries)
 Allocate and construct a U_EMR_RESIZEPALETTE record. More...
 
char * U_EMRREALIZEPALETTE_set (void)
 Allocate and construct a U_EMR_REALIZEPALETTE record. More...
 
char * U_EMREXTFLOODFILL_set (const U_POINTL ptlStart, const U_COLORREF crColor, const uint32_t iMode)
 Allocate and construct a U_EMR_EXTFLOODFILL record. More...
 
char * U_EMRLINETO_set (const U_POINTL ptl)
 Allocate and construct a U_EMR_LINETO record. More...
 
char * U_EMRARCTO_set (U_RECTL rclBox, U_POINTL ptlStart, U_POINTL ptlEnd)
 Allocate and construct a U_EMR_ARCTO record. More...
 
char * U_EMRPOLYDRAW_set (const U_RECTL rclBounds, const U_NUM_POINTL cptl, const U_POINTL *aptl, const uint8_t *abTypes)
 Allocate and construct a U_EMR_POLYDRAW record. More...
 
char * U_EMRSETARCDIRECTION_set (const uint32_t iArcDirection)
 Allocate and construct a U_EMR_SETARCDIRECTION record. More...
 
char * U_EMRSETMITERLIMIT_set (const uint32_t eMiterLimit)
 Allocate and construct a U_EMR_SETMITERLIMIT record. More...
 
char * U_EMRBEGINPATH_set (void)
 Allocate and construct a U_EMR_BEGINPATH record. More...
 
char * U_EMRENDPATH_set (void)
 Allocate and construct a U_EMR_ENDPATH record. More...
 
char * U_EMRCLOSEFIGURE_set (void)
 Allocate and construct a U_EMR_CLOSEFIGURE record. More...
 
char * U_EMRFILLPATH_set (const U_RECTL rclBox)
 Allocate and construct a U_EMR_FILLPATH record. More...
 
char * U_EMRSTROKEANDFILLPATH_set (const U_RECTL rclBox)
 Allocate and construct a U_EMR_STROKEANDFILLPATH record. More...
 
char * U_EMRSTROKEPATH_set (const U_RECTL rclBox)
 Allocate and construct a U_EMR_STROKEPATH record. More...
 
char * U_EMRFLATTENPATH_set (void)
 Allocate and construct a U_EMR_FLATTENPATH record. More...
 
char * U_EMRWIDENPATH_set (void)
 Allocate and construct a U_EMR_WIDENPATH record. More...
 
char * U_EMRSELECTCLIPPATH_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SELECTCLIPPATH record. More...
 
char * U_EMRABORTPATH_set (void)
 Allocate and construct a U_EMR_ABORTPATH record. More...
 
char * U_EMRCOMMENT_set (const U_CBDATA cbData, const char *Data)
 Allocate and construct a U_EMR_COMMENT record. More...
 
char * U_EMRFILLRGN_set (const U_RECTL rclBounds, const uint32_t ihBrush, const PU_RGNDATA RgnData)
 Allocate and construct a U_EMR_FILLRGN record. Use fillrgn_set() instead of calling this function directly. More...
 
char * U_EMRFRAMERGN_set (const U_RECTL rclBounds, const uint32_t ihBrush, const U_SIZEL szlStroke, const PU_RGNDATA RgnData)
 Allocate and construct a U_EMR_FRAMERGN record. Use framegrn_set() instead of calling this function directly. More...
 
char * U_EMRINVERTRGN_set (const PU_RGNDATA RgnData)
 Allocate and construct a U_EMR_INVERTRGN record. More...
 
char * U_EMRPAINTRGN_set (const PU_RGNDATA RgnData)
 Allocate and construct a U_EMR_PAINTRGN record. More...
 
char * U_EMREXTSELECTCLIPRGN_set (const uint32_t iMode, const PU_RGNDATA RgnData)
 Allocate and construct a U_EMR_EXTSELECTCLIPRGN record. More...
 
char * U_EMRBITBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_BITBLT record. More...
 
char * U_EMRSTRETCHBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_STRETCHBLT record. More...
 
char * U_EMRMASKBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk)
 Allocate and construct a U_EMR_MASKBLT record. More...
 
char * U_EMRPLGBLT_set (const U_RECTL rclBounds, const PU_POINTL aptlDst, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk)
 Allocate and construct a U_EMRPLGBLT record. More...
 
char * U_EMRSETDIBITSTODEVICE_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t iStartScan, const uint32_t cScans, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_SETDIBITSTODEVICE record. More...
 
char * U_EMRSTRETCHDIBITS_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_EMRSTRETCHDIBITS record. More...
 
char * U_EMREXTCREATEFONTINDIRECTW_set (const uint32_t ihFont, const char *elf, const char *elfw)
 Allocate and construct a U_EMR_EXTCREATEFONTINDIRECTW record. Use extcreatefontindirectw_set() instead of calling this function directly. More...
 
char * U_EMREXTTEXTOUTA_set (const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext)
 Allocate and construct a U_EMR_EXTTEXTOUTA record. More...
 
char * U_EMREXTTEXTOUTW_set (const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext)
 Allocate and construct a U_EMR_EXTTEXTOUTW record. More...
 
char * U_EMRPOLYBEZIER16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYBEZIER16 record. More...
 
char * U_EMRPOLYGON16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYGON16 record. More...
 
char * U_EMRPOLYLINE16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYLINE16 record. More...
 
char * U_EMRPOLYBEZIERTO16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYBEZIERTO record. More...
 
char * U_EMRPOLYLINETO16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYLINETO record. More...
 
char * U_EMRPOLYPOLYLINE16_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYPOLYLINE16 record. More...
 
char * U_EMRPOLYPOLYGON16_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points)
 Allocate and construct a U_EMR_POLYPOLYGON16 record. More...
 
char * U_EMRPOLYDRAW16_set (const U_RECTL rclBounds, const U_NUM_POINT16 cpts, const U_POINT16 *aptl, const uint8_t *abTypes)
 Allocate and construct a U_EMR_POLYDRAW16 record. More...
 
char * U_EMRCREATEMONOBRUSH_set (const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
 Allocate and construct a U_EMR_CREATEMONOBRUSH record. More...
 
char * U_EMRCREATEDIBPATTERNBRUSHPT_set (const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px)
 Allocate and construct a U_EMR_CREATEDIBPATTERNBRUSHPT record. Use createdibpatternbrushpt_set() instead of calling this function directly. More...
 
char * U_EMREXTCREATEPEN_set (const uint32_t ihPen, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_EXTLOGPEN elp)
 Allocate and construct a U_EMR_EXTCREATEPEN record. Use extcreatepen_set() instead of calling this function directly. More...
 
char * U_EMRSETICMMODE_set (const uint32_t iMode)
 Allocate and construct a U_EMR_SETICMMODE record. More...
 
char * U_EMRCREATECOLORSPACE_set (const uint32_t ihCS, const U_LOGCOLORSPACEA lcs)
 Allocate and construct a U_EMR_CREATECOLORSPACE record. Use createcolorspace_set() instead of calling this function directly. More...
 
char * U_EMRSETCOLORSPACE_set (const uint32_t ihCS)
 Allocate and construct a U_EMR_SETCOLORSPACE record. More...
 
char * U_EMRDELETECOLORSPACE_set (const uint32_t ihCS)
 Allocate and construct a U_EMR_DELETECOLORSPACE record. More...
 
char * U_EMRPIXELFORMAT_set (const U_PIXELFORMATDESCRIPTOR pfd)
 Allocate and construct a U_EMR_PIXELFORMAT record. More...
 
char * U_EMRSMALLTEXTOUT_set (const U_POINTL Dest, const U_NUM_STR cChars, const uint32_t fuOptions, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const U_RECTL rclBounds, const char *TextString)
 Allocate and construct a U_EMR_SMALLTEXTOUT record. More...
 
char * U_EMRALPHABLEND_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_BLEND Blend, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_ALPHABLEND record. More...
 
char * U_EMRSETLAYOUT_set (uint32_t iMode)
 Allocate and construct a U_EMR_SETLAYOUT record. More...
 
char * U_EMRTRANSPARENTBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t TColor, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px)
 Allocate and construct a U_EMR_TRANSPARENTBLT record. More...
 
char * U_EMRGRADIENTFILL_set (const U_RECTL rclBounds, const U_NUM_TRIVERTEX nTriVert, const U_NUM_GRADOBJ nGradObj, const uint32_t ulMode, const PU_TRIVERTEX TriVert, const uint32_t *GradObj)
 Allocate and construct a U_EMR_TRANSPARENTBLT record. More...
 
char * U_EMRCREATECOLORSPACEW_set (const uint32_t ihCS, const U_LOGCOLORSPACEW lcs, const uint32_t dwFlags, const U_CBDATA cbData, const uint8_t *Data)
 Allocate and construct a U_EMR_CREATECOLORSPACEW record. Use createcolorspacew_set() instead of calling this function directly. More...
 

Detailed Description

Functions for manipulating EMF files and structures.

[U_EMR]_set all take data and return a pointer to memory holding the constructed record. The size of that record is also returned in recsize. It is also in the second int32 in the record, but may have been byte swapped and so not usable. If something goes wrong a NULL pointer is returned and recsize is set to 0.

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

PU_BITMAPINFO bitmapinfo_set ( U_BITMAPINFOHEADER  BmiHeader,
PU_RGBQUAD  BmiColors 
)

Allocate and construct a U_BITMAPINFO structure.

Returns
Pointer to a U_BITMAPINFO structure
Parameters
BmiHeaderGeometry and pixel properties
BmiColorsColor table (must be NULL for some values of BmiHeader->biBitCount)
U_BITMAPINFOHEADER bitmapinfoheader_set ( int32_t  biWidth,
int32_t  biHeight,
uint16_t  biPlanes,
uint16_t  biBitCount,
uint32_t  biCompression,
uint32_t  biSizeImage,
int32_t  biXPelsPerMeter,
int32_t  biYPelsPerMeter,
U_NUM_RGBQUAD  biClrUsed,
uint32_t  biClrImportant 
)

Construct a U_BITMAPINFOHEADER structure.

Returns
U_BITMAPINFOHEADER structure
Parameters
biWidthBitmap width in pixels
biHeightBitmap height in pixels
biPlanesPlanes (must be 1)
biBitCountBitCount Enumeration
biCompressionBI_Compression Enumeration
biSizeImageSize in bytes of image
biXPelsPerMeterX Resolution in pixels/meter
biYPelsPerMeterY Resolution in pixels/meter
biClrUsedNumber of bmciColors in U_BITMAPCOREINFO
biClrImportantNumber of bmciColors needed (0 means all).
U_COLORADJUSTMENT coloradjustment_set ( uint16_t  Size,
uint16_t  Flags,
uint16_t  IlluminantIndex,
uint16_t  RedGamma,
uint16_t  GreenGamma,
uint16_t  BlueGamma,
uint16_t  ReferenceBlack,
uint16_t  ReferenceWhite,
int16_t  Contrast,
int16_t  Brightness,
int16_t  Colorfulness,
int16_t  RedGreenTint 
)

Construct a U_COLORADJUSTMENT structure.

Returns
U_COLORADJUSTMENT structure
Parameters
SizeSize of this structure in bytes
FlagsColorAdjustment Enumeration
IlluminantIndexIlluminant Enumeration
RedGammaRed Gamma correction (range:2500:65000, 10000 is no correction)
GreenGammaGreen Gamma correction (range:2500:65000, 10000 is no correction)
BlueGammaBlue Gamma correction (range:2500:65000, 10000 is no correction)
ReferenceBlackValues less than this are black (range:0:4000)
ReferenceWhiteValues more than this are white (range:6000:10000)
ContrastContrast adjustment (range:-100:100, 0 is no correction)
BrightnessBrightness adjustment (range:-100:100, 0 is no correction)
ColorfulnessColorfulness adjustment (range:-100:100, 0 is no correction)
RedGreenTintTine adjustment (range:-100:100, 0 is no correction)
U_COLORREF colorref3_set ( uint8_t  red,
uint8_t  green,
uint8_t  blue 
)

Set a U_COLORREF value from separate R,G,B values.

Parameters
redRed component
greenGreen component
blueBlue component
U_COLORREF colorref4_set ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  Reserved 
)

Set a U_COLORREF value from separate R,G,B, and Reserved values.

Parameters
redRed component
greenGreen component
blueBlue component
ReservedReserved component
char* createbrushindirect_set ( uint32_t *  ihBrush,
EMFHANDLES eht,
U_LOGBRUSH  lb 
)

Allocate and construct a U_EMRCREATEBRUSHINDIRECT structure, create a handle and returns it Use this function instead of calling U_EMRCREATEBRUSHINDIRECT_set() directly.

Returns
pointer to U_EMRCREATEBRUSHINDIRECT structure, or NULL on error.
Parameters
ihBrushhandle to be used by new object
ehtEMF handle table
lbBrush parameters
char* createcolorspace_set ( uint32_t *  ihCS,
EMFHANDLES eht,
U_LOGCOLORSPACEA  lcs 
)

Allocate and construct a U_EMRCREATECOLORSPACE structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACE_set() directly.

Returns
pointer to U_EMRCREATECOLORSPACE structure, or NULL on error.
Parameters
ihCSColorSpace handle, will be created and returned
ehtPointer to structure holding all EMF handles
lcsColorSpace parameters
char* createcolorspacew_set ( uint32_t *  ihCS,
EMFHANDLES eht,
U_LOGCOLORSPACEW  lcs,
uint32_t  dwFlags,
U_CBDATA  cbData,
uint8_t *  Data 
)

Allocate and construct a U_EMRCREATECOLORSPACEW structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACEW_set() directly.

Returns
pointer to U_EMRCREATECOLORSPACEW structure, or NULL on error.
Parameters
ihCSColorSpace handle, will be created and returned
ehtPointer to structure holding all EMF handles
lcsColorSpace parameters
dwFlagsIf low bit set Data is present
cbDataNumber of bytes of theData field.
Data(Optional, dwFlags & 1) color profile data
char* createdibpatternbrushpt_set ( uint32_t *  ihBrush,
EMFHANDLES eht,
const uint32_t  iUsage,
PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
const char *  Px 
)

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

Returns
pointer to U_EMRCREATEDIBPATTERNBRUSHPT_set structure, or NULL on error.
Parameters
ihBrushhandle to be used by new object
ehtEMF 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* createmonobrush_set ( uint32_t *  ihBrush,
EMFHANDLES eht,
const uint32_t  iUsage,
PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
const char *  Px 
)

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

Returns
pointer to U_EMRCREATEMONOBRUSH_set structure, or NULL on error.
Parameters
ihBrushhandle to be used by new object
ehtEMF 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* createpalette_set ( uint32_t *  ihPal,
EMFHANDLES eht,
U_LOGPALETTE  lgpl 
)

Allocate and construct a U_EMRCREATEPALETTE structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPALETTE_set() directly.

Returns
pointer to U_EMRCREATEPALETTE structure, or NULL on error.
Parameters
ihPalPalette handle, will be created and returned
ehtPointer to structure holding all EMF handles
lgplPaletteFont parameters
char* createpen_set ( uint32_t *  ihPen,
EMFHANDLES eht,
U_LOGPEN  lopn 
)

Allocate and construct a U_EMRCREATEPEN structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPEN_set() directly.

Returns
pointer to U_EMRCREATEPEN structure, or NULL on error.
Parameters
ihPenhandle to be used by new object
ehtEMF handle table
lopnPen parameters
char* deleteobject_set ( uint32_t *  ihObject,
EMFHANDLES eht 
)

Allocate and construct a U_EMRDELETEOBJECT structure and also delete the requested object from the table. Use this function instead of calling U_EMRDELETEOBJECT_set() directly.

Returns
pointer to U_EMRDELETEOBJECT structure, or NULL on error.
Parameters
ihObjectPointer to handle to delete. This value is set to 0 if the function succeeds.
ehtEMF 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_EMRDELETEOBJECT record or a NULL, and other errors could result in the NULL. So the object must be checked before the call.

int device_size ( const int  xmm,
const int  ymm,
const float  dpmm,
U_SIZEL szlDev,
U_SIZEL szlMm 
)

Set up fields for an EMR_HEADER from the physical device's width and height in mm and dots per millimeter. Typically this is something like 216,279,47.244 (Letter paper, 1200 DPI = 47.244 DPmm)

Returns
0 for success, >=1 for failure.
Parameters
xmmDevice width in millimeters
ymmDevice height in millimeters
dpmmDots per millimeter
szlDevDevice size structure in pixels
szlMmDevice size structure in mm
int DIB_to_RGBA ( const char *  px,
const U_RGBQUAD ct,
int  numCt,
char **  rgba_px,
int  w,
int  h,
uint32_t  colortype,
int  use_ct,
int  invert 
)

Convert one of many different types of DIB pixmaps to an RGBA 32 bit pixmap.

Returns
0 on success, other values on errors.
Parameters
pxDIB pixel array
ctDIB color table
numCtDIB color table number of entries
rgba_pxU_RGBA pixel array (32 bits), created by this routine, caller must free.
wWidth of pixel array in the record
hHeight of pixel array in the record
colortypeDIB BitCount Enumeration
use_ctKept for symmetry with RGBA_to_DIB, should be set to numCt
invertIf DIB rows are in opposite order from RGBA rows
int drawing_size ( const int  xmm,
const int  ymm,
const float  dpmm,
U_RECTL rclBounds,
U_RECTL rclFrame 
)

Set up fields for an EMR_HEADER for drawing by physical size in mm and dots per millimeter. Technically rclBounds is supposed to be the extent of the drawing within the EMF, but libUEMF has no way of knowing this since it never actually draws anything. Instead this is set to the full drawing size. Coordinates are inclusive inclusive, so 297 -> 0,29699.

Returns
0 for success, >=1 for failure.
Parameters
xmmDrawing width in millimeters
ymmDrawing height in millimeters
dpmmDots per millimeter
rclBoundsDrawing size structure in pixels
rclFrameDrawing size structure in mm
void dumpeht ( char *  string,
unsigned int *  handle,
EMFHANDLES eht 
)

Dump an EMFHANDLES structure. Not for use in production code.

Parameters
stringText to output before dumping eht structure
handleHandle
ehtEMFHANDLES structure to dump
uint32_t* dx_set ( int32_t  height,
uint32_t  weight,
uint32_t  members 
)

Make up an approximate dx array to pass to emrtext_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
int emf_append ( U_ENHMETARECORD rec,
EMFTRACK et,
int  freerec 
)

Append an EMF record to an emf in memory. This may reallocate buf memory.

Returns
0 for success, >=1 for failure.
Parameters
recRecord to append to EMF in memory
etEMF in memory
freerecIf true, free rec after append
int emf_finish ( EMFTRACK et,
EMFHANDLES eht 
)

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

Returns
0 on success, >=1 on failure
Parameters
etEMF in memory
ehtEMF handle table (peak handle number needed)
FILE* emf_fopen ( const char *  filename,
const int  mode 
)

wrapper for fopen, works on any platform

Returns
0 on success, >=1 on failure
Parameters
filenamefile to open (either ASCII or UTF-8)
modeU_READ or U_WRITE (these map to "rb" and "wb")
int emf_free ( EMFTRACK **  et)

Release memory for an emf structure in memory. Call this after emf_finish().

Returns
0 on success, >=1 on failure
Parameters
etEMF in memory
int emf_htable_create ( uint32_t  initsize,
uint32_t  chunksize,
EMFHANDLES **  eht 
)

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
ehtEMF handle table
int emf_htable_delete ( uint32_t *  ih,
EMFHANDLES eht 
)

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
ehtEMF handle table
int emf_htable_free ( EMFHANDLES **  eht)

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

Returns
0 for success, >=1 for failure.
Parameters
ehtEMF handle table
int emf_htable_insert ( uint32_t *  ih,
EMFHANDLES eht 
)

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
ehtEMF handle table
int emf_readdata ( const char *  filename,
char **  contents,
size_t *  length 
)

Retrieve contents of an EMF 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 emf_start ( const char *  name,
const uint32_t  initsize,
const uint32_t  chunksize,
EMFTRACK **  et 
)

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

Returns
0 for success, >=0 for failure.
Parameters
nameEMF filename (will be opened)
initsizeInitialize EMF in memory to hold this many bytes
chunksizeWhen needed increase EMF in memory by this number of bytes
etEMF in memory
int emr_arc_points ( PU_ENHMETARECORD  record,
int *  f1,
int  f2,
PU_PAIRF  center,
PU_PAIRF  start,
PU_PAIRF  end,
PU_PAIRF  size 
)

Derive from an EMF arc, chord, or pie the center, start, and end points, and the bounding rectangle.

Returns
0 on success, other values on errors.
Parameters
recordU_EMRPIE, U_EMRCHORD, or _EMRARC record
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.
int emr_arc_points_common ( PU_RECTL  rclBox,
PU_POINTL  ArcStart,
PU_POINTL  ArcEnd,
int *  f1,
int  f2,
PU_PAIRF  center,
PU_PAIRF  start,
PU_PAIRF  end,
PU_PAIRF  size 
)

Derive from bounding rect, start and end radials, for arc, chord, or pie, the center, start, and end points, and the bounding rectangle.

Returns
0 on success, other values on errors.
Parameters
rclBoxbounding rectangle
ArcStartstart of arc
ArcEndend 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* emr_dup ( const char *  emr)

Duplicate an EMR record.

Parameters
emrrecord to duplicate
uint32_t emr_properties ( uint32_t  type)

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

Returns
bitmap of EMR record properties, or U_EMR_INVALID on error or release of all memory
Parameters
typeEMR record type. If U_EMR_INVALID release memory. (There is no U_EMR_INVALID EMR record type)
char* emrtext_set ( U_POINTL  ptlReference,
U_NUM_STR  NumString,
uint32_t  cbChar,
void *  String,
uint32_t  fOptions,
U_RECTL  rcl,
uint32_t *  Dx 
)

Allocate and create a U_EMRTEXT structure followed by its variable pieces via a char* pointer. Dx cannot be NULL, if the calling program has no appropriate values call dx_set() first.

Returns
char* pointer to U_EMRTEXT structure followed by its variable pieces, or NULL on error
Parameters
ptlReferenceString start coordinates
NumStringNumber of characters in string, does NOT include a terminator
cbCharNumber of bytes per character
StringString to write
fOptionsExtTextOutOptions Enumeration
rcl(Optional, when fOptions & 7) grayed/clipping/opaque rectangle
DxCharacter spacing array from the start of the RECORD
char* extcreatefontindirectw_set ( uint32_t *  ihFont,
EMFHANDLES eht,
const char *  elf,
const char *  elfw 
)

Allocate and construct a U_EMREXTCREATEFONTINDIRECTW structure, create a handle and returns it Use this function instead of calling U_EMREXTCREATEFONTINDIRECTW_set() directly.

Returns
pointer to U_EMREXTCREATEFONTINDIRECTW structure, or NULL on error.
Parameters
ihFontFont handle, will be created and returned
ehtPointer to structure holding all EMF handles
elfPointer to Font parameters asPU_LOGFONT
elfwPointer to Font parameters as U_LOGFONT_PANOSE
char* extcreatepen_set ( uint32_t *  ihPen,
EMFHANDLES eht,
PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px,
PU_EXTLOGPEN  elp 
)

Allocate and construct a U_EMREXTCREATEPEN structure, create a handle and return it. Use this function instead of calling U_EMREXTCREATEPEN_set() directly.

Returns
pointer to U_EMREXTCREATEPEN structure, or NULL on error.
Parameters
ihPenhandle to be used by new object
ehtEMF handle table
Bmibitmapbuffer
cbPxSize in bytes of pixel array (row stride * height, there may be some padding at the end of each row)
Pxpixel array (NULL if cbPx == 0)
elpPen parameters (Size is Variable!!!!)
PU_EXTLOGPEN extlogpen_set ( uint32_t  elpPenStyle,
uint32_t  elpWidth,
uint32_t  elpBrushStyle,
U_COLORREF  elpColor,
int32_t  elpHatch,
U_NUM_STYLEENTRY  elpNumEntries,
U_STYLEENTRY elpStyleEntry 
)

Allocate and construct a U_EXTLOGPEN structure.

Returns
pointer to U_EXTLOGPEN structure, or NULL on error
Parameters
elpPenStylePenStyle Enumeration
elpWidthWidth in logical units (elpPenStyle & U_PS_GEOMETRIC) or 1 (pixel)
elpBrushStyleLB_Style Enumeration
elpColorPen color
elpHatchHatchStyle Enumeration
elpNumEntriesCount of StyleEntry array
elpStyleEntryArray of StyleEntry (For user specified dot/dash patterns)
char* fillrgn_set ( uint32_t *  ihBrush,
EMFHANDLES eht,
const U_RECTL  rclBounds,
const PU_RGNDATA  RgnData 
)

Allocate and construct a U_EMRFILLRGN structure, create a handle and returns it Use this function instead of calling U_EMRFILLRGN_set() directly.

Returns
pointer to U_EMRFILLRGN structure, or NULL on error.
Parameters
ihBrushBrush handle, will be created and returned
ehtPointer to structure holding all EMF handles
rclBoundsBounding rectangle in device units
RgnDataPointer to a U_RGNDATA structure
U_RECT findbounds ( uint32_t  count,
PU_POINT  pts,
uint32_t  width 
)

Find the bounding rectangle from a polyline of a given width.

Parameters
countnumber of points in the polyline
ptsthe polyline
widthwidth of drawn line
U_RECT findbounds16 ( uint32_t  count,
PU_POINT16  pts,
uint32_t  width 
)

Find the bounding rectangle from a polyline of a given width.

Parameters
countnumber of points in the polyline
ptsthe polyline
widthwidth of drawn line
char* framergn_set ( uint32_t *  ihBrush,
EMFHANDLES eht,
const U_RECTL  rclBounds,
const U_SIZEL  szlStroke,
const PU_RGNDATA  RgnData 
)

Allocate and construct a U_EMRFRAMERGN structure, create a handle and returns it Use this function instead of calling U_EMRFRAMERGN_set() directly.

Returns
pointer to U_EMRFRAMERGN structure, or NULL on error.
Parameters
ihBrushBrush handle, will be created and returned
ehtPointer to structure holding all EMF handles
rclBoundsBounding rectangle in device units
szlStrokeW & H of Brush stroke
RgnDataPointer to a U_RGNDATA structure
int get_DIB_params ( void *  pEmr,
uint32_t  offBitsSrc,
uint32_t  offBmiSrc,
const char **  px,
const U_RGBQUAD **  ct,
uint32_t *  numCt,
uint32_t *  width,
uint32_t *  height,
uint32_t *  colortype,
uint32_t *  invert 
)

Get the DIB parameters from the BMI of the record for 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
pEmrpointer to EMR record that has a U_BITMAPINFO and bitmap
offBitsSrcOffset to the bitmap
offBmiSrcOffset to the U_BITMAPINFO
pxpointer to DIB pixel array in pEmr
ctpointer to DIB color table in pEmr
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
int get_real_color_count ( const char *  Bmih)

Get the actual number of colors in the color table from the BitMapInfoHeader.

Returns
Number of entries in the color table.
Parameters
Bmihchar * pointer to the U_BITMAPINFOHEADER

BitmapInfoHeader may list 0 for some types which implies the maximum value. If the image is big enough, that is set by the bit count, as in 256 for an 8 bit image. If the image is smaller it is set by width * height. Note, this may be called by WMF code, so it is not safe to assume the data is aligned.

int get_real_color_icount ( int  Colors,
int  BitCount,
int  Width,
int  Height 
)

Get the actual number of colors in the color table from the ClrUsed, BitCount, Width, and Height.

Returns
Number of entries in the color table.
Parameters
ColorsNumber of colors in the table.
BitCountBitCount Enumeration
Widthbitmap width
Heightbitmap height
U_LOGBRUSH logbrush_set ( uint32_t  lbStyle,
U_COLORREF  lbColor,
int32_t  lbHatch 
)

Construct a U_LOGBRUSH structure.

Returns
U_LOGBRUSH structure
Parameters
lbStyleLB_Style Enumeration
lbColorBrush color
lbHatchHatchStyle Enumertaion
U_LOGCOLORSPACEA logcolorspacea_set ( int32_t  lcsCSType,
int32_t  lcsIntent,
U_CIEXYZTRIPLE  lcsEndpoints,
U_LCS_GAMMARGB  lcsGammaRGB,
char *  lcsFilename 
)

Construct a U_LOGCOLORSPACEA structure.

Returns
U_LOGCOLORSPACEA structure
Parameters
lcsCSTypeLCS_CSType Enumeration
lcsIntentLCS_Intent Enumeration
lcsEndpointsCIE XYZ color space endpoints
lcsGammaRGBGamma For RGB
lcsFilenameCould name an external color profile file, otherwise empty string
U_LOGCOLORSPACEW logcolorspacew_set ( int32_t  lcsCSType,
int32_t  lcsIntent,
U_CIEXYZTRIPLE  lcsEndpoints,
U_LCS_GAMMARGB  lcsGammaRGB,
uint16_t *  lcsFilename 
)

Construct a U_LOGCOLORSPACEW structure.

Returns
U_LOGCOLORSPACEW structure
Parameters
lcsCSTypeLCS_CSType Enumeration
lcsIntentLCS_Intent Enumeration
lcsEndpointsCIE XYZ color space endpoints
lcsGammaRGBGamma For RGB
lcsFilenameCould name an external color profile file, otherwise empty string
U_LOGFONT_PANOSE logfont_panose_set ( U_LOGFONT  elfLogFont,
uint16_t *  elfFullName,
uint16_t *  elfStyle,
uint32_t  elfStyleSize,
U_PANOSE  elfPanose 
)

Construct a U_LOGFONT_PANOSE structure.

Returns
U_LOGFONT_PANOSE structure
Parameters
elfLogFontBasic font attributes
elfFullNameFont full name, truncates at U_LF_FULLFACESIZE, smaller must be null terminated
elfStyleFont style, truncates at U_LF_FULLFACESIZE, smaller must be null terminated
elfStyleSizeFont hinting starting at this point size, if 0, starts at Height
elfPanosePanose Object. If all zero, it is ignored.
U_LOGFONT logfont_set ( int32_t  lfHeight,
int32_t  lfWidth,
int32_t  lfEscapement,
int32_t  lfOrientation,
int32_t  lfWeight,
uint8_t  lfItalic,
uint8_t  lfUnderline,
uint8_t  lfStrikeOut,
uint8_t  lfCharSet,
uint8_t  lfOutPrecision,
uint8_t  lfClipPrecision,
uint8_t  lfQuality,
uint8_t  lfPitchAndFamily,
uint16_t *  lfFaceName 
)

Construct a U_LOGFONT structure.

Returns
U_LOGFONT structure
Parameters
lfHeightHeight in Logical units
lfWidthAverage Width in Logical units
lfEscapementAngle in 0.1 degrees betweem escapement vector and X axis
lfOrientationAngle in 0.1 degrees between baseline and X axis
lfWeightLF_Weight Enumeration
lfItalicItalics: 0 or 1
lfUnderlineUnderline: 0 or 1
lfStrikeOutStrikeout: 0 or 1
lfCharSetLF_CharSet Enumeration
lfOutPrecisionLF_OutPrecision Enumeration
lfClipPrecisionLF_ClipPrecision Enumeration
lfQualityLF_Quality Enumeration
lfPitchAndFamilyLF_PitchAndFamily Enumeration
lfFaceNameName of font. truncates at U_LF_FACESIZE, smaller must be null terminated
PU_LOGPALETTE logpalette_set ( U_NUM_LOGPLTNTRY  palNumEntries,
PU_LOGPLTNTRY palPalEntry 
)

Allocate and construct a U_LOGPALETTE structure.

Returns
pointer to U_LOGPALETTE structure, or NULL on error.
Parameters
palNumEntriesNumber of U_LOGPLTNTRY objects
palPalEntryarray, PC_Entry Enumeration
U_LOGPEN logpen_set ( uint32_t  lopnStyle,
U_POINT  lopnWidth,
U_COLORREF  lopnColor 
)

Construct a U_LOGPEN structure.

Returns
U_LOGPEN structure
Parameters
lopnStylePenStyle Enumeration
lopnWidthWidth of pen set by X, Y is ignored
lopnColorPen color value
U_LOGPLTNTRY logpltntry_set ( uint8_t  peReserved,
uint8_t  peRed,
uint8_t  peGreen,
uint8_t  peBlue 
)

Construct a U_LOGPLTNTRY structure.

Returns
U_LOGPLTNTRY structure
Parameters
peReservedIgnore
peRedPalette entry Red Intensity
peGreenPalette entry Green Intensity
peBluePalette entry Blue Intensity
int memprobe ( const void *  buf,
size_t  size 
)

Debugging utility, used with valgrind to find uninitialized values. Not for use in production code.

Parameters
bufmemory area to examine !
sizelength in bytes of buf!
U_PANOSE panose_set ( uint8_t  bFamilyType,
uint8_t  bSerifStyle,
uint8_t  bWeight,
uint8_t  bProportion,
uint8_t  bContrast,
uint8_t  bStrokeVariation,
uint8_t  bArmStyle,
uint8_t  bLetterform,
uint8_t  bMidline,
uint8_t  bXHeight 
)

Construct a U_PANOSE structure.

Returns
U_PANOSE structure
Parameters
bFamilyTypeFamilyType Enumeration
bSerifStyleSerifType Enumeration
bWeightWeight Enumeration
bProportionProportion Enumeration
bContrastContrast Enumeration
bStrokeVariationStrokeVariation Enumeration
bArmStyleArmStyle Enumeration
bLetterformLetterform Enumeration
bMidlineMidline Enumeration
bXHeightXHeight Enumeration
U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set ( uint32_t  dwFlags,
uint8_t  iPixelType,
uint8_t  cColorBits,
uint8_t  cRedBits,
uint8_t  cRedShift,
uint8_t  cGreenBits,
uint8_t  cGreenShift,
uint8_t  cBlueBits,
uint8_t  cBlueShift,
uint8_t  cAlphaBits,
uint8_t  cAlphaShift,
uint8_t  cAccumBits,
uint8_t  cAccumRedBits,
uint8_t  cAccumGreenBits,
uint8_t  cAccumBlueBits,
uint8_t  cAccumAlphaBits,
uint8_t  cDepthBits,
uint8_t  cStencilBits,
uint8_t  cAuxBuffers,
uint8_t  iLayerType,
uint8_t  bReserved,
uint32_t  dwLayerMask,
uint32_t  dwVisibleMask,
uint32_t  dwDamageMask 
)

Construct a U_PIXELFORMATDESCRIPTOR structure.

Returns
U_PIXELFORMATDESCRIPTOR structure
Parameters
dwFlagsPFD_dwFlags Enumeration
iPixelTypePFD_iPixelType Enumeration
cColorBitsRGBA: total bits per pixel
cRedBitsRed bits per pixel
cRedShiftRed shift to data bits
cGreenBitsGreen bits per pixel
cGreenShiftGreen shift to data bits
cBlueBitsBlue bits per pixel
cBlueShiftBlue shift to data bits
cAlphaBitsAlpha bits per pixel
cAlphaShiftAlpha shift to data bits
cAccumBitsAccumulator buffer, total bitplanes
cAccumRedBitsRed accumulator buffer bitplanes
cAccumGreenBitsGreen accumulator buffer bitplanes
cAccumBlueBitsBlue accumulator buffer bitplanes
cAccumAlphaBitsAlpha accumulator buffer bitplanes
cDepthBitsDepth of Z-buffer
cStencilBitsDepth of stencil buffer
cAuxBuffersDepth of auxilliary buffers (not supported)
iLayerTypePFD_iLayerType Enumeration, may be ignored
bReservedBits 0:3/4:7 are number of Overlay/Underlay planes
dwLayerMaskmay be ignored
dwVisibleMaskcolor or index of underlay plane
dwDamageMaskmay be ignored
U_POINT16 point16_set ( int16_t  x,
int16_t  y 
)

Set point16 objects with 16 bit X,Y values.

Parameters
xX coordinate
yY coordinate
PU_POINT point16_to_point ( PU_POINT16  points,
int  count 
)

Allocate and construct an array of U_POINT objects from a set of U_POINT16 objects.

Returns
pointer to an array of U_POINT structures.
Parameters
pointspointer to the source U_POINT16 structures
countnumber of members in points
PU_POINT16 point16_transform ( PU_POINT16  points,
int  count,
U_XFORM  xform 
)

Allocate and construct an array of U_POINT16 objects which has been subjected to a U_XFORM.

Returns
pointer to an array of U_POINT16 structures.
Parameters
pointspointer to the source U_POINT16 structures
countnumber of members in points
xformU_XFORM to apply

Transformed src points {x0,y0} appear at {x0*xscale + x, y0*yscale + y}

U_POINTL point32_set ( int32_t  x,
int32_t  y 
)

Set pointl objects with X,Y values.

Parameters
xX coordinate
yY coordinate
PU_POINT16 point_to_point16 ( PU_POINT  points,
int  count 
)

Allocate and construct an array of U_POINT16 objects from a set of U_POINT objects.

Returns
pointer to an array of U_POINT16 structures.
Parameters
pointspointer to the source U_POINT structures
countnumber of members in points

If a coordinate is out of range it saturates at boundary.

PU_POINT points_transform ( PU_POINT  points,
int  count,
U_XFORM  xform 
)

Allocate and construct an array of U_POINT objects which has been subjected to a U_XFORM.

Returns
pointer to an array of U_POINT structures.
Parameters
pointspointer to the source U_POINT structures
countnumber of members in points
xformU_XFORM to apply

May also be used to modify U_RECT by doubling the count and casting the pointer.

U_RECTL rectl_set ( U_POINTL  ul,
U_POINTL  lr 
)

Set rect and rectl objects from Upper Left and Lower Right corner points.

Parameters
ulupper left corner of rectangle
lrlower right corner of rectangle
int RGBA_to_DIB ( char **  px,
uint32_t *  cbPx,
PU_RGBQUAD ct,
int *  numCt,
const char *  rgba_px,
int  w,
int  h,
int  stride,
uint32_t  colortype,
int  use_ct,
int  invert 
)

Convert a U_RGBA 32 bit pixmap to one of many different types of DIB pixmaps.

Conversions to formats using color tables assume that the color table can hold every color in the input image. If that assumption is false then the conversion will fail. Conversion from 8 bit color to N bit colors (N<8) do so by shifting the appropriate number of bits.

Returns
0 on success, other values on errors.
Parameters
pxDIB pixel array
cbPxDIB pixel array size in bytes
ctDIB color table
numCtDIB color table number of entries
rgba_pxU_RGBA pixel array (32 bits)
wWidth of pixel array
hHeight of pixel array
strideRow stride of input pixel array in bytes
colortypeDIB BitCount Enumeration
use_ctIf true use color table (only for 1-16 bit DIBs).
invertIf DIB rows are in opposite order from RGBA rows
char* RGBA_to_RGBA ( char *  rgba_px,
int  w,
int  h,
int  sl,
int  st,
int *  eew,
int *  eeh 
)

Extract a subset of an RGBA bitmap array. Frees the incoming bitmap array IF a subset is extracted, otherwise it is left alone. If the entire array is extracted it just returns the incoming pointer. If the subset requested is partially outside of the bitmap the region is clipped to the bitmap boundaries and extracted. This seems to be a (very) grey area in EMF files, and even different Microsoft applications do not always do the same thing. For instance, XP Preview gives some different images for EMR_BITBLT records than does the "import image" (but not unpacked) view in PowerPoint. Since all of these states are probably best viewed as undefined or errors we can only try to do something reasonable and not blow up when encountering one.

Returns
Pointer to the sub array on success, NULL otherwise.
Parameters
rgba_pxU_RGBA pixel array (32 bits), created by this routine, caller must free.
wWidth of pixel array in the record
hHeight of pixel array in the record
slstart left position in the pixel array in the record to start extracting
ststart top position in the pixel array in the record to start extracting
eewWidth of pixel array to extract
eehHeight of pixel array to extract
U_RGBQUAD rgbquad_set ( uint8_t  red,
uint8_t  green,
uint8_t  blue,
uint8_t  reserved 
)

Set a U_RGBQUAD value from separate R,G,B, Reserved values.

Parameters
redRed component
greenGreen component
blueBlue component
reservedReserved component
PU_RGNDATA rgndata_set ( U_RGNDATAHEADER  rdh,
PU_RECTL  Buffer 
)

Allocate and construct a U_RGNDATA structure.

Returns
pointer to U_RGNDATA structure, or NULL on error.
Parameters
rdhData description
BufferArray of U_RECTL elements
U_RGNDATAHEADER rgndataheader_set ( U_NUM_RECTL  nCount,
U_RECTL  rclBounds 
)

Construct a U_RGNDATAHEADER structure.

Returns
U_RGNDATAHEADER structure
Parameters
nCountNumber of rectangles in region
rclBoundsRegion bounds
char* selectobject_set ( uint32_t  ihObject,
EMFHANDLES eht 
)

Allocate and construct a U_EMRSELECTOBJECT structure, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_EMRSELECTOBJECT_set() directly.

Returns
pointer to U_EMRSELECTOBJECT structure, or NULL on error.
Parameters
ihObjecthandle to select
ehtEMF handle table
char* setpaletteentries_set ( uint32_t *  ihPal,
EMFHANDLES eht,
const uint32_t  iStart,
const U_NUM_LOGPLTNTRY  cEntries,
const PU_LOGPLTNTRY  aPalEntries 
)

Allocate and construct a U_EMRSETPALETTEENTRIES structure, create a handle and returns it Use this function instead of calling U_EMRSETPALETTEENTRIES_set() directly.

Returns
pointer to U_EMRSETPALETTEENTRIES structure, or NULL on error.
Parameters
ihPalPalette handle, will be created and returned
ehtPointer to structure holding all EMF handles
iStartFirst Palette entry in selected object to set
cEntriesNumber of Palette entries in selected object to set
aPalEntriesValues to set with
U_SIZEL sizel_set ( int32_t  x,
int32_t  y 
)

Set sizel objects with X,Y values.

Parameters
xX coordinate
yY coordinate
char* textcomment_set ( const char *  string)

Allocate and construct a U_EMRCOMMENT structure with a UTF8 string. A U_EMRCOMMENT contains application specific data, and that may include contain null characters. This function may be used when the comment only incluces UT8 text.

Returns
pointer to U_EMRCOMMENT structure, or NULL on error.
Parameters
stringUTF8 string to store in the comment
PU_TRIVERTEX trivertex_transform ( PU_TRIVERTEX  tv,
int  count,
U_XFORM  xform 
)

Allocate and construct an array of U_TRIVERTEX objects which has been subjected to a U_XFORM.

Returns
pointer to an array of U_TRIVERTEX structures.
Parameters
tvpointer to the source U_TRIVERTEX structures
countnumber of members in points
xformU_XFORM to apply

Transformed Trivertex points {x0,y0} appear at {x0*xscale + x, y0*yscale + y}

char* U_emr_names ( unsigned int  idx)

Look up the name of the EMR record by type. Returns U_EMR_INVALID if out of range.

Returns
name of the EMR record, "U_EMR_INVALID" if out of range.
Parameters
idxEMR record type.
char* U_EMRABORTPATH_set ( void  )

Allocate and construct a U_EMR_ABORTPATH record.

Returns
pointer to U_EMR_ABORTPATH record, or NULL on error.
char* U_EMRALPHABLEND_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_POINTL  cSrc,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const U_BLEND  Blend,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_ALPHABLEND record.

Returns
pointer to U_EMR_ALPHABLEND record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination width in logical units
SrcSource UL corner in logical units
cSrcSrc W & H in logical units
xformSrcTransform to apply to source
crBkColorSrcBackground color
iUsageSrcDIBcolors Enumeration
BlendBlend function
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 )
char* U_EMRANGLEARC_set ( const U_POINTL  ptlCenter,
const uint32_t  nRadius,
const U_FLOAT  eStartAngle,
const U_FLOAT  eSweepAngle 
)

Allocate and construct a U_EMR_ANGLEARC record.

Returns
pointer to U_EMR_ANGLEARC record, or NULL on error.
Parameters
ptlCenterCenter in logical units
nRadiusRadius in logical units
eStartAngleStarting angle in degrees (counter clockwise from x axis)
eSweepAngleSweep angle in degrees
char* U_EMRARC_set ( const U_RECTL  rclBox,
const U_POINTL  ptlStart,
const U_POINTL  ptlEnd 
)

Allocate and construct a U_EMR_ARC record.

Returns
pointer to U_EMR_ARC record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
ptlStartStart point in logical units
ptlEndEnd point in logical units
char* U_EMRARCTO_set ( U_RECTL  rclBox,
U_POINTL  ptlStart,
U_POINTL  ptlEnd 
)

Allocate and construct a U_EMR_ARCTO record.

Returns
pointer to U_EMR_ARCTO record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
ptlStartStart point in logical units
ptlEndEnd point in logical units

Note that the draw begins with a line from the current point to ptlStart, which is not indicated in the Microsoft EMF documentation for this record.

char* U_EMRBEGINPATH_set ( void  )

Allocate and construct a U_EMR_BEGINPATH record.

Returns
pointer to U_EMR_BEGINPATH record, or NULL on error.
char* U_EMRBITBLT_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const uint32_t  dwRop,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_BITBLT record.

Returns
pointer to U_EMR_BITBLT record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination width in logical units
SrcSource rectangle UL corner in logical units
xformSrcSource bitmap transform (world to page coordinates)
crBkColorSrcSource bitmap background color
iUsageSrcDIBcolors Enumeration
dwRopTernary Raster Operation 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 )
char* U_EMRCHORD_set ( const U_RECTL  rclBox,
const U_POINTL  ptlStart,
const U_POINTL  ptlEnd 
)

Allocate and construct a U_EMR_CHORD record.

Returns
pointer to U_EMR_CHORD record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
ptlStartStart point in logical units
ptlEndEnd point in logical units
char* U_EMRCLOSEFIGURE_set ( void  )

Allocate and construct a U_EMR_CLOSEFIGURE record.

Returns
pointer to U_EMR_CLOSEFIGURE record, or NULL on error.
char* U_EMRCOMMENT_set ( const U_CBDATA  cbData,
const char *  Data 
)

Allocate and construct a U_EMR_COMMENT record.

Returns
pointer to U_EMR_COMMENT record, or NULL on error.
Parameters
cbDataNumber of bytes in comment
DataComment (any binary data, interpretation is program specific)
char* U_EMRCREATEBRUSHINDIRECT_set ( const uint32_t  ihBrush,
const U_LOGBRUSH  lb 
)

Allocate and construct a U_EMR_CREATEBRUSHINDIRECT record. Use createbrushindirect_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATEBRUSHINDIRECT record, or NULL on error.
Parameters
ihBrushIndex to place object in EMF object table (this entry must not yet exist)
lbBrush properties
char* U_EMRCREATECOLORSPACE_set ( const uint32_t  ihCS,
const U_LOGCOLORSPACEA  lcs 
)

Allocate and construct a U_EMR_CREATECOLORSPACE record. Use createcolorspace_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATECOLORSPACE record, or NULL on error.
Parameters
ihCSIndex to place object in EMF object table (this entry must not yet exist)
lcsColorSpace parameters
char* U_EMRCREATECOLORSPACEW_set ( const uint32_t  ihCS,
const U_LOGCOLORSPACEW  lcs,
const uint32_t  dwFlags,
const U_CBDATA  cbData,
const uint8_t *  Data 
)

Allocate and construct a U_EMR_CREATECOLORSPACEW record. Use createcolorspacew_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATECOLORSPACEW record, or NULL on error.
Parameters
ihCSIndex to place object in EMF object table (this entry must not yet exist)
lcsColorSpace parameters
dwFlagsIf low bit set Data is present
cbDataNumber of bytes of theData field.
Data(Optional, dwFlags & 1) color profile data
char* U_EMRCREATEDIBPATTERNBRUSHPT_set ( const uint32_t  ihBrush,
const uint32_t  iUsage,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_EMR_CREATEDIBPATTERNBRUSHPT record. Use createdibpatternbrushpt_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATEDIBPATTERNBRUSHPT record, or NULL on error.
Parameters
ihBrushIndex to place object in EMF object table (this entry must not yet exist)
iUsageDIBcolors Enumeration
Bmi(Optional) bitmapbuffer (U_BITMAPINFO + pixel array)
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* U_EMRCREATEMONOBRUSH_set ( const uint32_t  ihBrush,
const uint32_t  iUsage,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
const char *  Px 
)

Allocate and construct a U_EMR_CREATEMONOBRUSH record.

Returns
pointer to U_EMR_CREATEMONOBRUSH record, or NULL on error.
Parameters
ihBrushIndex to place object in EMF object table (this entry must not yet exist)
iUsageDIBcolors Enumeration
Bmi(Optional) bitmapbuffer (U_BITMAPINFO + pixel array)
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* U_EMRCREATEPALETTE_set ( const uint32_t  ihPal,
const U_LOGPALETTE  lgpl 
)

Allocate and construct a U_EMR_CREATEPALETTE record. Use createpalette_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATEPALETTE record, or NULL on error.
Parameters
ihPalIndex to place object in EMF object table (this entry must not yet exist)
lgplPalette properties
char* U_EMRCREATEPEN_set ( const uint32_t  ihPen,
const U_LOGPEN  lopn 
)

Allocate and construct a U_EMR_CREATEPEN record. Use createpen_set() instead of calling this function directly.

Returns
pointer to U_EMR_CREATEPEN record, or NULL on error.
Parameters
ihPenHandle of created pen
lopnU_LOGPEN structure describing this pen
char* U_EMRDELETECOLORSPACE_set ( const uint32_t  ihCS)

Allocate and construct a U_EMR_DELETECOLORSPACE record.

Returns
pointer to U_EMR_DELETECOLORSPACE record, or NULL on error.
Parameters
ihCSIndex of object in EMF object table
char* U_EMRDELETEOBJECT_set ( const uint32_t  ihObject)

Allocate and construct a U_EMR_DELETEOBJECT record. Use deleteobject_set() instead of calling this function directly.

Returns
pointer to U_EMR_DELETEOBJECT record, or NULL on error.
Parameters
ihObjectNumber of a stock or created object
char* U_EMRELLIPSE_set ( const U_RECTL  rclBox)

Allocate and construct a U_EMR_ELLIPSE record.

Returns
pointer to U_EMR_ELLIPSE record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
char* U_EMRENDPATH_set ( void  )

Allocate and construct a U_EMR_ENDPATH record.

Returns
pointer to U_EMR_ENDPATH record, or NULL on error.
char* U_EMREOF_set ( const U_CBPLENTRIES  cbPalEntries,
const PU_LOGPLTNTRY  PalEntries,
EMFTRACK et 
)

Allocate and construct a U_EMR_EOF record.

Returns
pointer to U_EMR_EOF record, or NULL on error.
Parameters
cbPalEntriesNumber of palette entries
PalEntries(optional) array of PalEntries
ettracking information, needed for nSizeLast calculation
char* U_EMREXCLUDECLIPRECT_set ( const U_RECTL  rclClip)

Allocate and construct a U_EMR_EXCLUDECLIPRECT record.

Returns
pointer to U_EMR_EXCLUDECLIPRECT record, or NULL on error.
Parameters
rclClipClipping Region
char* U_EMREXTCREATEFONTINDIRECTW_set ( const uint32_t  ihFont,
const char *  elf,
const char *  elfw 
)

Allocate and construct a U_EMR_EXTCREATEFONTINDIRECTW record. Use extcreatefontindirectw_set() instead of calling this function directly.

Returns
pointer to U_EMR_EXTCREATEFONTINDIRECTW record, or NULL on error.
Parameters
ihFontIndex of the font in the EMF object table
elfFont parameters as U_LOGFONT
elfwFont parameters as U_LOGFONT_PANOSE
char* U_EMREXTCREATEPEN_set ( const uint32_t  ihPen,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px,
const PU_EXTLOGPEN  elp 
)

Allocate and construct a U_EMR_EXTCREATEPEN record. Use extcreatepen_set() instead of calling this function directly.

Returns
pointer to U_EMR_EXTCREATEPEN record, or NULL on error.
Parameters
ihPenihPen Index to place object in EMF object table (this entry must not yet exist)
BmiBmi bitmapbuffer
cbPxcbPx Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row)
PxPx pixel array (NULL if cbPx == 0)
elpelp Pen parameters (Size is Variable!!!!)
char* U_EMREXTFLOODFILL_set ( const U_POINTL  ptlStart,
const U_COLORREF  crColor,
const uint32_t  iMode 
)

Allocate and construct a U_EMR_EXTFLOODFILL record.

Returns
pointer to U_EMR_EXTFLOODFILL record, or NULL on error.
Parameters
ptlStartStart point in logical units
crColorColor to fill with
iModeFloodFill Enumeration
char* U_EMREXTSELECTCLIPRGN_set ( const uint32_t  iMode,
const PU_RGNDATA  RgnData 
)

Allocate and construct a U_EMR_EXTSELECTCLIPRGN record.

Returns
pointer to U_EMR_EXTSELECTCLIPRGN or NULL on error.
Parameters
iModeRegionMode Enumeration
RgnDataVariable size U_RGNDATA structure
char* U_EMREXTTEXTOUTA_set ( const U_RECTL  rclBounds,
const uint32_t  iGraphicsMode,
const U_FLOAT  exScale,
const U_FLOAT  eyScale,
const PU_EMRTEXT  emrtext 
)

Allocate and construct a U_EMR_EXTTEXTOUTA record.

Returns
pointer to U_EMR_EXTTEXTOUTA record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
iGraphicsModeGraphics mode Enumeration
exScalescale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE)
eyScalescale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE)
emrtextText parameters
char* U_EMREXTTEXTOUTW_set ( const U_RECTL  rclBounds,
const uint32_t  iGraphicsMode,
const U_FLOAT  exScale,
const U_FLOAT  eyScale,
const PU_EMRTEXT  emrtext 
)

Allocate and construct a U_EMR_EXTTEXTOUTW record.

Returns
pointer to U_EMR_EXTTEXTOUTW record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
iGraphicsModeGraphics mode Enumeration
exScalescale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE)
eyScalescale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE)
emrtextText parameters
char* U_EMRFILLPATH_set ( const U_RECTL  rclBox)

Allocate and construct a U_EMR_FILLPATH record.

Returns
pointer to U_EMR_FILLPATH record, or NULL on error.
Parameters
rclBoxBounding rectangle in device units

U_EMR_FILLPATH closes the open figure before filling.

char* U_EMRFILLRGN_set ( const U_RECTL  rclBounds,
const uint32_t  ihBrush,
const PU_RGNDATA  RgnData 
)

Allocate and construct a U_EMR_FILLRGN record. Use fillrgn_set() instead of calling this function directly.

Returns
pointer to U_EMR_FILLRGN record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
ihBrushIndex of a Brush object in the EMF object table
RgnDataPointer to a U_RGNDATA structure
char* U_EMRFLATTENPATH_set ( void  )

Allocate and construct a U_EMR_FLATTENPATH record.

Returns
pointer to U_EMR_FLATTENPATH record, or NULL on error.
char* U_EMRFRAMERGN_set ( const U_RECTL  rclBounds,
const uint32_t  ihBrush,
const U_SIZEL  szlStroke,
const PU_RGNDATA  RgnData 
)

Allocate and construct a U_EMR_FRAMERGN record. Use framegrn_set() instead of calling this function directly.

Returns
pointer to U_EMR_FRAMERGN record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
ihBrushIndex of a Brush object in the EMF object table
szlStrokeW & H of Brush stroke
RgnDataPointer to a U_RGNDATA structure
char* U_EMRGRADIENTFILL_set ( const U_RECTL  rclBounds,
const U_NUM_TRIVERTEX  nTriVert,
const U_NUM_GRADOBJ  nGradObj,
const uint32_t  ulMode,
const PU_TRIVERTEX  TriVert,
const uint32_t *  GradObj 
)

Allocate and construct a U_EMR_TRANSPARENTBLT record.

Returns
pointer to U_EMR_TRANSPARENTBLT record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
nTriVertNumber of TriVertex objects in TriVert
nGradObjNumber of gradient triangle/rectangle objects
ulModeGradientfill Enumeration (determines Triangle/Rectangle)
TriVertArray of TriVertex objects
GradObjArray of gradient objects (each has 2 [rect] or 3 [triangle] indices into TriVert array)
char* U_EMRHEADER_set ( const U_RECTL  rclBounds,
const U_RECTL  rclFrame,
U_PIXELFORMATDESCRIPTOR *const  pfmtDesc,
U_CBSTR  nDesc,
uint16_t *const  Description,
const U_SIZEL  szlDevice,
const U_SIZEL  szlMillimeters,
const uint32_t  bOpenGL 
)

Allocate and construct a U_EMRHEADER record.

Returns
pointer to U_EMRHEADER record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
rclFrameBounding rectangle in 0.01 mm units
pfmtDescPointer to a PixelFormatDescriptor
nDescnumber of characters in Description, will include first three '\0'
DescriptionDescription, formatted like: text1\0text2\0\0
szlDeviceReference device size in pixels
szlMillimetersReference device size in 0.01 mm
bOpenGLnonZero if OpenGL commands are included
char* U_EMRINTERSECTCLIPRECT_set ( const U_RECTL  rclClip)

Allocate and construct a U_EMR_INTERSECTCLIPRECT record.

Returns
pointer to U_EMR_INTERSECTCLIPRECT record, or NULL on error.
Parameters
rclClipClipping Region
char* U_EMRINVERTRGN_set ( const PU_RGNDATA  RgnData)

Allocate and construct a U_EMR_INVERTRGN record.

Returns
pointer to U_EMR_INVERTRGN record, or NULL on error.
Parameters
RgnDataVariable size U_RGNDATA structure
char* U_EMRLINETO_set ( const U_POINTL  ptl)

Allocate and construct a U_EMR_LINETO record.

Returns
pointer to U_EMR_LINETO record, or NULL on error.
Parameters
ptlPoint coordinates
char* U_EMRMASKBLT_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const U_POINTL  Mask,
const uint32_t  iUsageMask,
const uint32_t  dwRop,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px,
const PU_BITMAPINFO  MskBmi,
const uint32_t  cbMsk,
char *  Msk 
)

Allocate and construct a U_EMR_MASKBLT record.

Returns
pointer to U_EMR_MASKBLT record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination width in logical units
SrcSource UL corner in logical units
xformSrcTransform to apply to source
crBkColorSrcBackground color
iUsageSrcDIBcolors Enumeration
MaskMask UL corner in logical units
iUsageMaskDIBcolors Enumeration
dwRopTernary Raster Operation 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 )
MskBmi(Optional) bitmapbuffer (U_BITMAPINFO section)
cbMskSize in bytes of mask array (row stride * height, there may be some padding at the end of each row)
Msk(Optional) bitmapbuffer (mask section )
char* U_EMRMODIFYWORLDTRANSFORM_set ( const U_XFORM  xform,
const uint32_t  iMode 
)

Allocate and construct a U_EMR_MODIFYWORLDTRANSFORM record.

Returns
pointer to U_EMR_MODIFYWORLDTRANSFORM record, or NULL on error.
Parameters
xformTransform to use
iModeModifyWorldTransformMode Enumeration
char* U_EMRMOVETOEX_set ( const U_POINTL  ptl)

Allocate and construct a U_EMR_MOVETOEX record.

Returns
pointer to U_EMR_MOVETOEX record, or NULL on error.
Parameters
ptlPoint coordinates
char* U_EMROFFSETCLIPRGN_set ( const U_POINTL  ptl)

Allocate and construct a U_EMR_OFFSETCLIPRGN record.

Returns
pointer to U_EMR_OFFSETCLIPRGN record, or NULL on error.
Parameters
ptlClipping region
char* U_EMRPAINTRGN_set ( const PU_RGNDATA  RgnData)

Allocate and construct a U_EMR_PAINTRGN record.

Returns
pointer to U_EMR_PAINTRGN record, or NULL on error.
Parameters
RgnDataVariable size U_RGNDATA structure
char* U_EMRPIE_set ( const U_RECTL  rclBox,
const U_POINTL  ptlStart,
const U_POINTL  ptlEnd 
)

Allocate and construct a U_EMR_PIE record.

Returns
pointer to U_EMR_PIE record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
ptlStartStart point in logical units
ptlEndEnd point in logical units
char* U_EMRPIXELFORMAT_set ( const U_PIXELFORMATDESCRIPTOR  pfd)

Allocate and construct a U_EMR_PIXELFORMAT record.

Returns
pointer to U_EMR_PIXELFORMAT record, or NULL on error.
Parameters
pfdPixelFormatDescriptor
char* U_EMRPLGBLT_set ( const U_RECTL  rclBounds,
const PU_POINTL  aptlDst,
const U_POINTL  Src,
const U_POINTL  cSrc,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const U_POINTL  Mask,
const uint32_t  iUsageMask,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px,
const PU_BITMAPINFO  MskBmi,
const uint32_t  cbMsk,
char *  Msk 
)

Allocate and construct a U_EMRPLGBLT record.

Returns
U_EMRPLGBLT record.
Parameters
rclBoundsBounding rectangle in device units
aptlDstDefines parallelogram, UL, UR, LL corners, LR is derived (3 points)
SrcSource UL corner in logical units
cSrcSource width in logical units
xformSrcTransform to apply to source
crBkColorSrcBackground color
iUsageSrcDIBcolors Enumeration
MaskMask UL corner in logical units
iUsageMaskDIBcolors 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 )
MskBmi(Optional) bitmapbuffer (U_BITMAPINFO section)
cbMskSize in bytes of mask array (row stride * height, there may be some padding at the end of each row)
Msk(Optional) bitmapbuffer (mask section )
char* U_EMRPOLYBEZIER16_set ( const U_RECTL  rclBounds,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYBEZIER16 record.

Returns
pointer to U_EMR_POLYBEZIER16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYBEZIER_set ( const U_RECTL  rclBounds,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYBEZIER record.

Returns
pointer to U_EMR_POLYBEZIER record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
cptlNumber of points to draw
pointsarray of points
char* U_EMRPOLYBEZIERTO16_set ( const U_RECTL  rclBounds,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYBEZIERTO record.

Returns
pointer to U_EMR_POLYBEZIERTO record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYBEZIERTO_set ( const U_RECTL  rclBounds,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYBEZIERTO record.

Returns
pointer to U_EMR_POLYBEZIERTO record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
cptlNumber of points to draw
pointsarray of points
char* U_EMRPOLYDRAW16_set ( const U_RECTL  rclBounds,
const U_NUM_POINT16  cpts,
const U_POINT16 aptl,
const uint8_t *  abTypes 
)

Allocate and construct a U_EMR_POLYDRAW16 record.

Returns
pointer to U_EMR_POLYDRAW16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of U_POINTL objects
aptlArray of U_POINTL objects
abTypesArray of Point Enumeration
char* U_EMRPOLYDRAW_set ( const U_RECTL  rclBounds,
const U_NUM_POINTL  cptl,
const U_POINTL aptl,
const uint8_t *  abTypes 
)

Allocate and construct a U_EMR_POLYDRAW record.

Returns
pointer to U_EMR_POLYDRAW record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptlNumber of U_POINTL objects
aptlArray of U_POINTL objects
abTypesArray of Point Enumeration
char* U_EMRPOLYGON16_set ( const U_RECTL  rclBounds,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYGON16 record.

Returns
pointer to U_EMR_POLYGON16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYGON_set ( const U_RECTL  rclBounds,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYGON record.

Returns
pointer to U_EMR_POLYGON record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
cptlNumber of points to draw
pointsarray of points
char* U_EMRPOLYLINE16_set ( const U_RECTL  rclBounds,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYLINE16 record.

Returns
pointer to U_EMR_POLYLINE16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYLINE_set ( const U_RECTL  rclBounds,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYLINE record.

Returns
pointer to U_EMR_POLYLINE record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
cptlNumber of points to draw
pointsarray of points
char* U_EMRPOLYLINETO16_set ( const U_RECTL  rclBounds,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYLINETO record.

Returns
pointer to U_EMR_POLYLINETO record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYLINETO_set ( const U_RECTL  rclBounds,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYLINETO record.

Returns
pointer to U_EMR_POLYLINETO record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
cptlNumber of points to draw
pointsarray of points
char* U_EMRPOLYPOLYGON16_set ( const U_RECTL  rclBounds,
const uint32_t  nPolys,
const uint32_t *  aPolyCounts,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYPOLYGON16 record.

Returns
pointer to U_EMR_POLYPOLYGON16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYPOLYGON_set ( const U_RECTL  rclBounds,
const uint32_t  nPolys,
const uint32_t *  aPolyCounts,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYPOLYGON record.

Returns
pointer to U_EMR_POLYPOLYGON record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
cptlTotal number of points (over all poly)
pointsarray of points
char* U_EMRPOLYPOLYLINE16_set ( const U_RECTL  rclBounds,
const uint32_t  nPolys,
const uint32_t *  aPolyCounts,
const uint32_t  cpts,
const U_POINT16 points 
)

Allocate and construct a U_EMR_POLYPOLYLINE16 record.

Returns
pointer to U_EMR_POLYPOLYLINE16 record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
cptsNumber of POINT16 in array
pointsArray of POINT16
char* U_EMRPOLYPOLYLINE_set ( const U_RECTL  rclBounds,
const uint32_t  nPolys,
const uint32_t *  aPolyCounts,
const uint32_t  cptl,
const U_POINTL points 
)

Allocate and construct a U_EMR_POLYPOLYLINE record.

Returns
pointer to U_EMR_POLYPOLYLINE record, or NULL on error.
Parameters
rclBoundsbounding rectangle in device units
nPolysNumber of elements in aPolyCounts
aPolyCountsNumber of points in each poly (sequential)
cptlTotal number of points (over all poly)
pointsarray of points
char* U_EMRREALIZEPALETTE_set ( void  )

Allocate and construct a U_EMR_REALIZEPALETTE record.

Returns
pointer to U_EMR_REALIZEPALETTE record, or NULL on error.
char* U_EMRRECTANGLE_set ( const U_RECTL  rclBox)

Allocate and construct a U_EMR_RECTANGLE record.

Returns
pointer to U_EMR_RECTANGLE record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
char* U_EMRRESIZEPALETTE_set ( const uint32_t  ihPal,
const uint32_t  cEntries 
)

Allocate and construct a U_EMR_RESIZEPALETTE record.

Returns
pointer to U_EMR_RESIZEPALETTE record, or NULL on error.
Parameters
ihPalIndex of a Palette object in the EMF object table
cEntriesNumber to expand or truncate the Palette entry list to
char* U_EMRRESTOREDC_set ( const int32_t  iRelative)

Allocate and construct a U_EMR_RESTOREDC record.

Returns
pointer to U_EMR_RESTOREDC record, or NULL on error.
Parameters
iRelativeDC to restore. -1 is preceding
char* U_EMRROUNDRECT_set ( const U_RECTL  rclBox,
const U_SIZEL  szlCorner 
)

Allocate and construct a U_EMR_ROUNDRECT record.

Returns
pointer to U_EMR_ROUNDRECT record, or NULL on error.
Parameters
rclBoxbounding rectangle in logical units
szlCornerW & H in logical units of ellipse used to round corner
char* U_EMRSAVEDC_set ( void  )

Allocate and construct a U_EMR_SAVEDC record.

Returns
pointer to U_EMR_SAVEDC record, or NULL on error.
char* U_EMRSCALEVIEWPORTEXTEX_set ( const int32_t  xNum,
const int32_t  xDenom,
const int32_t  yNum,
const int32_t  yDenom 
)

Allocate and construct a U_EMR_SCALEVIEWPORTEXTEX record.

Returns
pointer to U_EMR_SCALEVIEWPORTEXTEX record, or NULL on error.
Parameters
xNumHorizontal multiplier (!=0)
xDenomHorizontal divisor (!=0)
yNumVertical multiplier (!=0)
yDenomVertical divisor (!=0)
char* U_EMRSCALEWINDOWEXTEX_set ( const int32_t  xNum,
const int32_t  xDenom,
const int32_t  yNum,
const int32_t  yDenom 
)

Allocate and construct a U_EMR_SCALEWINDOWEXTEX record.

Returns
pointer to U_EMR_SCALEWINDOWEXTEX record, or NULL on error.
Parameters
xNumHorizontal multiplier (!=0)
xDenomHorizontal divisor (!=0)
yNumVertical multiplier (!=0)
yDenomVertical divisor (!=0)
char* U_EMRSELECTCLIPPATH_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SELECTCLIPPATH record.

Returns
pointer to U_EMR_SELECTCLIPPATH record, or NULL on error.
Parameters
iModeRegionMode Enumeration
char* U_EMRSELECTOBJECT_set ( const uint32_t  ihObject)

Allocate and construct a U_EMR_SELECTOBJECT record. Use selectobject_set() instead of calling this function directly.

Returns
pointer to U_EMR_SELECTOBJECT record, or NULL on error.
Parameters
ihObjectNumber of a stock or created object
char* U_EMRSELECTPALETTE_set ( const uint32_t  ihPal)

Allocate and construct a U_EMR_SELECTPALETTE record.

Returns
pointer to U_EMR_SELECTPALETTE record, or NULL on error.
Parameters
ihPalIndex of a Palette object in the EMF object table
char* U_EMRSETARCDIRECTION_set ( const uint32_t  iArcDirection)

Allocate and construct a U_EMR_SETARCDIRECTION record.

Returns
pointer to U_EMR_SETARCDIRECTION record, or NULL on error.
Parameters
iArcDirectionArcDirection Enumeration
char* U_EMRSETBKCOLOR_set ( const U_COLORREF  crColor)

Allocate and construct a U_EMR_SETBKCOLOR record.

Returns
pointer to U_EMR_SETBKCOLOR record, or NULL on error.
Parameters
crColorBackground Color
char* U_EMRSETBKMODE_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETBKMODE record.

Returns
pointer to U_EMR_SETBKMODE record, or NULL on error.
Parameters
iModeBackgroundMode Enumeration
char* U_EMRSETBRUSHORGEX_set ( const U_POINTL  ptlOrigin)

Allocate and construct a U_EMR_SETBRUSHORGEX record.

Returns
pointer to U_EMR_SETBRUSHORGEX record, or NULL on error.
Parameters
ptlOriginH & V origin in logical units
char* U_EMRSETCOLORADJUSTMENT_set ( const U_COLORADJUSTMENT  ColorAdjustment)

Allocate and construct a U_EMR_SETCOLORADJUSTMENT record.

Returns
pointer to U_EMR_SETCOLORADJUSTMENT record, or NULL on error.
Parameters
ColorAdjustmentColor Adjustment
char* U_EMRSETCOLORSPACE_set ( const uint32_t  ihCS)

Allocate and construct a U_EMR_SETCOLORSPACE record.

Returns
pointer to U_EMR_SETCOLORSPACE record, or NULL on error.
Parameters
ihCSIndex of object in EMF object table
char* U_EMRSETDIBITSTODEVICE_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  Src,
const U_POINTL  cSrc,
const uint32_t  iUsageSrc,
const uint32_t  iStartScan,
const uint32_t  cScans,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_SETDIBITSTODEVICE record.

Returns
pointer to U_EMR_SETDIBITSTODEVICE record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
iUsageSrcDIBColors Enumeration
iStartScanFirst scan line
cScansNumber of scan lines
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 )
char* U_EMRSETICMMODE_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETICMMODE record.

Returns
pointer to U_EMR_SETICMMODE record, or NULL on error.
Parameters
iModeICMMode Enumeration
char* U_EMRSETLAYOUT_set ( uint32_t  iMode)

Allocate and construct a U_EMR_SETLAYOUT record.

Returns
pointer to U_EMR_SETLAYOUT record, or NULL on error.
Parameters
iModeMirroring Enumeration
char* U_EMRSETMAPMODE_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETMAPMODE record.

Returns
pointer to U_EMR_SETMAPMODE record, or NULL on error.
Parameters
iModeMapMode Enumeration
char* U_EMRSETMAPPERFLAGS_set ( void  )

Allocate and construct a U_EMR_SETMAPPERFLAGS record.

Returns
pointer to U_EMR_SETMAPPERFLAGS record, or NULL on error.
char* U_EMRSETMETARGN_set ( void  )

Allocate and construct a U_EMR_SETMETARGN record.

Returns
pointer to U_EMR_SETMETARGN record, or NULL on error.
char* U_EMRSETMITERLIMIT_set ( const uint32_t  eMiterLimit)

Allocate and construct a U_EMR_SETMITERLIMIT record.

Returns
pointer to U_EMR_SETMITERLIMIT record, or NULL on error.
Parameters
eMiterLimitMapMode Enumeration
char* U_EMRSETPALETTEENTRIES_set ( const uint32_t  ihPal,
const uint32_t  iStart,
const U_NUM_LOGPLTNTRY  cEntries,
const PU_LOGPLTNTRY  aPalEntries 
)

Allocate and construct a U_EMR_SETPALETTEENTRIES record. Use setpaletteentries_set() instead of calling this function directly.

Returns
pointer to U_EMR_SETPALETTEENTRIES record, or NULL on error.
Parameters
ihPalIndex of a Palette object in the EMF object table
iStartFirst Palette entry in selected object to set
cEntriesNumber of Palette entries in selected object to set
aPalEntriesValues to set with
char* U_EMRSETPIXELV_set ( const U_POINTL  ptlPixel,
const U_COLORREF  crColor 
)

Allocate and construct a U_EMR_SETPIXELV record.

Returns
pointer to U_EMR_SETPIXELV record, or NULL on error.
Parameters
ptlPixelPixel coordinates (logical)
crColorPixel color
char* U_EMRSETPOLYFILLMODE_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETPOLYFILLMODE record.

Returns
pointer to U_EMR_SETPOLYFILLMODE record, or NULL on error.
Parameters
iModePolygonFillMode Enumeration
char* U_EMRSETROP2_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETROP2 record.

Returns
pointer to U_EMR_SETROP2 record, or NULL on error.
Parameters
iModeRasterOperation2 Enumeration
char* U_EMRSETSTRETCHBLTMODE_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETSTRETCHBLTMODE record.

Returns
pointer to U_EMR_SETSTRETCHBLTMODE record, or NULL on error.
Parameters
iModeStretchMode Enumeration
char* U_EMRSETTEXTALIGN_set ( const uint32_t  iMode)

Allocate and construct a U_EMR_SETTEXTALIGN record.

Returns
pointer to U_EMR_SETTEXTALIGN record, or NULL on error.
Parameters
iModeTextAlignment Enumeration
char* U_EMRSETTEXTCOLOR_set ( const U_COLORREF  crColor)

Allocate and construct a U_EMR_SETTEXTCOLOR record.

Returns
pointer to U_EMR_SETTEXTCOLOR record, or NULL on error.
Parameters
crColorText Color
char* U_EMRSETVIEWPORTEXTEX_set ( const U_SIZEL  szlExtent)

Allocate and construct a U_EMR_SETVIEWPORTEXTEX record.

Returns
pointer to U_EMR_SETVIEWPORTEXTEX record, or NULL on error.
Parameters
szlExtentH & V extent in logical units
char* U_EMRSETVIEWPORTORGEX_set ( const U_POINTL  ptlOrigin)

Allocate and construct a U_EMR_SETVIEWPORTORGEX record.

Returns
pointer to U_EMR_SETVIEWPORTORGEX record, or NULL on error.
Parameters
ptlOriginH & V origin in logical units
char* U_EMRSETWINDOWEXTEX_set ( const U_SIZEL  szlExtent)

Allocate and construct a U_EMR_SETWINDOWEXTEX record.

Returns
pointer to U_EMR_SETWINDOWEXTEX record, or NULL on error.
Parameters
szlExtentH & V extent in logical units
char* U_EMRSETWINDOWORGEX_set ( const U_POINTL  ptlOrigin)

Allocate and construct a U_EMR_SETWINDOWORGEX record.

Returns
pointer to U_EMR_SETWINDOWORGEX record, or NULL on error.
Parameters
ptlOriginH & V origin in logical units
char* U_EMRSETWORLDTRANSFORM_set ( const U_XFORM  xform)

Allocate and construct a U_EMR_SETWORLDTRANSFORM record.

Returns
pointer to U_EMR_SETWORLDTRANSFORM record, or NULL on error.
Parameters
xformTransform to use
char* U_EMRSMALLTEXTOUT_set ( const U_POINTL  Dest,
const U_NUM_STR  cChars,
const uint32_t  fuOptions,
const uint32_t  iGraphicsMode,
const U_FLOAT  exScale,
const U_FLOAT  eyScale,
const U_RECTL  rclBounds,
const char *  TextString 
)

Allocate and construct a U_EMR_SMALLTEXTOUT record.

Returns
pointer to U_EMR_SMALLTEXTOUT record, or NULL on error.
Parameters
DestWhere to draw the text
cCharsCharacters in TextString (not null terminated)
fuOptionsExtTextOutOptions Enumeration
iGraphicsModeGraphicsMode Enumeration
exScalescale on X axis
eyScalescale on Y axis
rclBoundsOPTIONAL Bounding rectangle (absent when: fuOPtions & ETO_NO_U_RECT)
TextStringtext to output (fuOptions & ETO_SMALL_CHARS ? 8 bit : 16 bit)
char* U_EMRSTRETCHBLT_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_POINTL  cSrc,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const uint32_t  dwRop,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_STRETCHBLT record.

Returns
pointer to U_EMR_STRETCHBLT record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination width in logical units
SrcSource UL corner in logical units
cSrcSrc W & H in logical units
xformSrcTransform to apply to source
crBkColorSrcBackground color
iUsageSrcDIBcolors Enumeration
dwRopTernary Raster Operation 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 )
char* U_EMRSTRETCHDIBITS_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_POINTL  cSrc,
const uint32_t  iUsageSrc,
const uint32_t  dwRop,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_EMRSTRETCHDIBITS record.

Returns
pointer to U_EMR_EMRSTRETCHDIBITS record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination W & H in logical units
SrcSource UL corner in logical units
cSrcSource W & H in logical units
iUsageSrcDIBColors Enumeration
dwRopRasterOPeration 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 )
char* U_EMRSTROKEANDFILLPATH_set ( const U_RECTL  rclBox)

Allocate and construct a U_EMR_STROKEANDFILLPATH record.

Returns
pointer to U_EMR_STROKEANDFILLPATH record, or NULL on error.
Parameters
rclBoxBounding rectangle in device units

U_EMR_STROKEANDFILLPATH closes the open figure before filling and stroking. There appears to be no way to fill an open path while stroking it, as any one of U_EMRFILLPATH, U_EMRSTROKEPATH, or U_EMRSTROKEANDFILEPATH will "use up" the path,

char* U_EMRSTROKEPATH_set ( const U_RECTL  rclBox)

Allocate and construct a U_EMR_STROKEPATH record.

Returns
pointer to U_EMR_STROKEPATH record, or NULL on error.
Parameters
rclBoxBounding rectangle in device units

U_EMR_STROKEPATH does NOT close the open figure before stroking it.

char* U_EMRTRANSPARENTBLT_set ( const U_RECTL  rclBounds,
const U_POINTL  Dest,
const U_POINTL  cDest,
const U_POINTL  Src,
const U_POINTL  cSrc,
const U_XFORM  xformSrc,
const U_COLORREF  crBkColorSrc,
const uint32_t  iUsageSrc,
const uint32_t  TColor,
const PU_BITMAPINFO  Bmi,
const uint32_t  cbPx,
char *  Px 
)

Allocate and construct a U_EMR_TRANSPARENTBLT record.

Returns
pointer to U_EMR_TRANSPARENTBLT record, or NULL on error.
Parameters
rclBoundsBounding rectangle in device units
DestDestination UL corner in logical units
cDestDestination width in logical units
SrcSource UL corner in logical units
cSrcSrc W & H in logical units
xformSrcTransform to apply to source
crBkColorSrcBackground color
iUsageSrcDIBcolors Enumeration
TColorBitmap color to be treated as transparent
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 )
char* U_EMRWIDENPATH_set ( void  )

Allocate and construct a U_EMR_WIDENPATH record.

Returns
pointer to U_EMR_WIDENPATH record, or NULL on error.
U_XFORM xform_alt_set ( U_FLOAT  scale,
U_FLOAT  ratio,
U_FLOAT  rot,
U_FLOAT  axisrot,
U_FLOAT  eDx,
U_FLOAT  eDy 
)

Construct a U_XFORM structure.

Returns
U_XFORM structure
Parameters
scaleScale factor
ratioRatio of minor axis/major axis
rotRotation angle in degrees, positive is counter clockwise from the x axis.
axisrotAngle in degrees defining the major axis before rotation, positive is counter clockwise from the x axis.
eDxTranslation element
eDyTranslation element

Operation is: 1 Conformal map of points based on scale, axis rotation, and axis ratio,

  1. Apply rotation
  2. Apply offset
U_XFORM xform_set ( U_FLOAT  eM11,
U_FLOAT  eM12,
U_FLOAT  eM21,
U_FLOAT  eM22,
U_FLOAT  eDx,
U_FLOAT  eDy 
)

Construct a U_XFORM structure.

Returns
U_XFORM structure
Parameters
eM11Rotation Matrix element
eM12Rotation Matrix element
eM21Rotation Matrix element
eM22Rotation Matrix element
eDxTranslation element
eDyTranslation element