uLib
User mode C/C++ extended API library for Win32 programmers.
|
Additional region APIs...
Groups | |
Region Numbers | |
Classes | |
struct | GdiPathData |
Typedefs | |
typedef struct _gdiPathData * | PGdiPathData |
Functions | |
int WINAPI | MapRegionToWindow (HRGN hRgn, HWND hWnd) |
RGNDATA *WINAPI | AllocAndGetRegionData (IN HRGN hRgn, OPTOUT PRECT *ppRc) |
RGNDATA *WINAPI | FreeRegionData (RGNDATA *pRgn) |
void WINAPI | DumpRegionData (CSTR Title, HRGN hRgn) |
bool WINAPI | GetGdiPathData (HDC hdc, OUT PGdiPathData pData) |
void WINAPI | FreeGdiPathData (PGdiPathData pData) |
bool WINAPI | GetGdiPathBounds (HDC hdc, PRECT pBounds) |
HRGN WINAPI | GetGdiPathRgn (HDC hdc, OUT RGNDATA **ppRgnData, OPTOUT RECT **ppRgnRects) |
void | OffsetPoints (POINT *Pts, UINT nPts, int dx, int dy) |
void | OffsetRgnData (PRGNDATA prd, int dx, int dy) |
void | SetIdentityMat2 (MAT2 *pm) |
struct GdiPathData |
Data structure to use with GetGdiPathData().
Definition at line 2131 of file UtilFunc.h.
Class Members | ||
---|---|---|
LPPOINT | pPoint | Array of points. |
LPBYTE | pType | Array of type specs for each point. |
RECT | Bounds | Bounding rect for the whole path. |
int | nPoints | Nr of elements in the pPoint and pType arrays. |
typedef struct _gdiPathData * PGdiPathData |
Data structure to use with GetGdiPathData().
int WINAPI MapRegionToWindow | ( | HRGN | hRgn, |
HWND | hWnd | ||
) |
Offset the hRgn to hWnd.
The return value specifies the region's complexity. (See OffsetRgn().)
This function is primarily for use with GetRandomRgn().
Definition at line 610 of file GdiUtil.cpp.
RGNDATA* WINAPI AllocAndGetRegionData | ( | IN HRGN | hRgn, |
OPTOUT PRECT * | ppRc | ||
) |
Allocate a region data block and retrieve it with GetRegionData().
If provided, ppRc receives a pointer to the region's constituent RECTs.
Note:: Don't forget to FreeRegionData() when you're done.
RGNDATA* WINAPI FreeRegionData | ( | RGNDATA * | pRgn | ) |
Free an AllocAndGetRegionData() block.
Definition at line 629 of file GdiUtil.cpp.
void WINAPI DumpRegionData | ( | CSTR | Title, |
HRGN | hRgn | ||
) |
Dump region data to the debugger. (Only in uLib _DEBUG builds)
Definition at line 635 of file GdiUtil.cpp.
bool WINAPI GetGdiPathData | ( | HDC | hdc, |
OUT PGdiPathData | pData | ||
) |
GetGdiPathData() retrieves the current path data from a display context.
The path data is returned in a form suitable for use with PolyDraw().
The caller must supply a GdiPathData struct, which is filled by the function.
Dispose the data with FreeGdiPathData() when done.
Definition at line 660 of file GdiUtil.cpp.
void WINAPI FreeGdiPathData | ( | PGdiPathData | pData | ) |
FreeGdiPathData() disposes path data retrieved by GetGdiPathData().
Definition at line 707 of file GdiUtil.cpp.
bool WINAPI GetGdiPathBounds | ( | HDC | hdc, |
PRECT | pBounds | ||
) |
GetGdiPathBounds() computes the bounding rect for the current HDC path.
Definition at line 714 of file GdiUtil.cpp.
HRGN WINAPI GetGdiPathRgn | ( | HDC | hdc, |
OUT RGNDATA ** | ppRgnData, | ||
OPTOUT RECT ** | ppRgnRects | ||
) |
GetGdiPathRgn() converts the current HDC path to a region and retrieves the region data.
After conversion, GDI clears the path from the display context.
The region can be used to perform operations not available for paths.
Call FreeRegionData() when done.
hdc | Display context containing a closed path. |
ppRgnData | Pointer to a RGNDATA pointer that recieves the region data. |
ppRgnRects | Pointer to a RECT pointer that recieves the array of rects. |
Definition at line 728 of file GdiUtil.cpp.
void OffsetPoints | ( | POINT * | Pts, |
UINT | nPts, | ||
int | dx, | ||
int | dy | ||
) |
OffsetPoints() offsets an array of points by dx/dy.
Useful e.g to modify data from GetGdiPathData().
Definition at line 758 of file GdiUtil.cpp.
void OffsetRgnData | ( | PRGNDATA | prd, |
int | dx, | ||
int | dy | ||
) |
OffsetRgnData() offsets the retrieved region data by dx/dy.
Useful e.g to modify data from GetGdiPathRgn() in lieu of ExtCreateRegion().
Definition at line 770 of file GdiUtil.cpp.
void SetIdentityMat2 | ( | MAT2 * | pm | ) |
SetIdentityMat2() initializes a MAT2 to the identity matrix (i.e. no transform).
An initialized MAT2 is a mandatory parameter for GetGlyphOutline(),
but is somewhat of a PITA to initialize as there's no FIXED support.
(If you need to manipulate FIXED, have a look ar Fixed.hpp.)
Definition at line 782 of file GdiUtil.cpp.