uLib
User mode C/C++ extended API library for Win32 programmers.
|
GDI related functions... (GdiUtil.cpp)
Groups | |
FIXED 16.16 math support | |
Color Support | |
Font Support | |
Display Context Support | |
Bitmap Support | |
Gradient Support | |
Region Support | |
XFORM Support | |
Macros | |
#define | SYSHBR(id) GetSysColorBrush( COLOR_##id ) |
#define | SYSRGB(id) GetSysColor( COLOR_##id ) |
#define | BKGHBR(id) (HBRUSH)( 1 + COLOR_##id ) |
#define | RGBA(R, G, B, A) ((COLORREF) ((BYTE)(R)|((WORD)((BYTE)(G))<<8)|(((DWORD)(BYTE)(B))<<16)|(((DWORD)(BYTE)(A))<<24))) |
#define | GetAValue(rgba) ((BYTE)((COLORREF)(rgba) >> 24)) |
#define | GetRGBValue(rgba) ((COLORREF)((rgba) & 0x00FFFFFF)) |
#define | R4_MASKBLT MAKEROP4( SRCCOPY, DSTCOPY ) |
#define | DSTCOPY 0x00AA0029L |
#define | VLine(dc, x, y1, y2) Line( dc, x,y1, x,y2 ) |
#define | HLine(dc, y, x1, x2) Line( dc, x1,y, x2,y ) |
#define | GetSystemPalette() (HPALETTE)GetStockObject( DEFAULT_PALETTE ) |
#define | GetPaletteLength(hPal) GetPaletteEntries( hPal,0,0,NULL ) |
#define | DeleteFontEx(h) (HFONT) DeleteObjectEx( (HFONT)h ) |
#define | DeletePenEx(h) (HPEN) DeleteObjectEx( (HPEN)h ) |
#define | DeleteBrushEx(h) (HBRUSH) DeleteObjectEx( (HBRUSH)h ) |
#define | DeleteBitmapEx(h) (HBITMAP) DeleteObjectEx( (HBITMAP)h ) |
#define | DeleteRegionEx(h) (HRGN) DeleteObjectEx( (HRGN)h ) |
Functions | |
HGDIOBJ WINAPI | DeleteObjectEx (HGDIOBJ hObj) |
void WINAPI | Line (HDC hdc, int x1, int y1, int x2, int y2) |
void WINAPI | DrawIsoTriangle (HDC hdc, int xOrg, int yOrg, int Radius, double Orientation) |
void WINAPI | GetIsoTriangleVertices (POINT *Vtx, int xOrg, int yOrg, int Radius, double Orientation) |
#define SYSHBR | ( | id | ) | GetSysColorBrush( COLOR_##id ) |
Definition at line 1726 of file UtilFunc.h.
#define SYSRGB | ( | id | ) | GetSysColor( COLOR_##id ) |
Definition at line 1727 of file UtilFunc.h.
#define BKGHBR | ( | id | ) | (HBRUSH)( 1 + COLOR_##id ) |
Use this for WNDCLASS::hbrBackground.
Definition at line 1734 of file UtilFunc.h.
#define RGBA | ( | R, | |
G, | |||
B, | |||
A | |||
) | ((COLORREF) ((BYTE)(R)|((WORD)((BYTE)(G))<<8)|(((DWORD)(BYTE)(B))<<16)|(((DWORD)(BYTE)(A))<<24))) |
COLORREF with MSB alpha channel. Format = 0xAARRGGBB.
Definition at line 1738 of file UtilFunc.h.
#define GetAValue | ( | rgba | ) | ((BYTE)((COLORREF)(rgba) >> 24)) |
Get alpha from RGBA COLORREF value.
Definition at line 1740 of file UtilFunc.h.
#define GetRGBValue | ( | rgba | ) | ((COLORREF)((rgba) & 0x00FFFFFF)) |
Get RGB from RGBA COLORREF value.
Definition at line 1741 of file UtilFunc.h.
#define R4_MASKBLT MAKEROP4( SRCCOPY, DSTCOPY ) |
Quaternary raster op for a standard MaskBlt().
See also CreateMaskBitmap().
Definition at line 1747 of file UtilFunc.h.
#define DSTCOPY 0x00AA0029L |
Ternary raster op: Copy destination to destination, i.e. NOP.
2nd argument for MAKEROP4 to leave background bits as-is.
Definition at line 1752 of file UtilFunc.h.
#define VLine | ( | dc, | |
x, | |||
y1, | |||
y2 | |||
) | Line( dc, x,y1, x,y2 ) |
Definition at line 1756 of file UtilFunc.h.
#define HLine | ( | dc, | |
y, | |||
x1, | |||
x2 | |||
) | Line( dc, x1,y, x2,y ) |
Definition at line 1757 of file UtilFunc.h.
#define GetSystemPalette | ( | ) | (HPALETTE)GetStockObject( DEFAULT_PALETTE ) |
Definition at line 1761 of file UtilFunc.h.
#define GetPaletteLength | ( | hPal | ) | GetPaletteEntries( hPal,0,0,NULL ) |
Definition at line 1764 of file UtilFunc.h.
#define DeleteFontEx | ( | h | ) | (HFONT) DeleteObjectEx( (HFONT)h ) |
Definition at line 1771 of file UtilFunc.h.
#define DeletePenEx | ( | h | ) | (HPEN) DeleteObjectEx( (HPEN)h ) |
Definition at line 1772 of file UtilFunc.h.
#define DeleteBrushEx | ( | h | ) | (HBRUSH) DeleteObjectEx( (HBRUSH)h ) |
Definition at line 1773 of file UtilFunc.h.
#define DeleteBitmapEx | ( | h | ) | (HBITMAP) DeleteObjectEx( (HBITMAP)h ) |
Definition at line 1774 of file UtilFunc.h.
#define DeleteRegionEx | ( | h | ) | (HRGN) DeleteObjectEx( (HRGN)h ) |
Definition at line 1775 of file UtilFunc.h.
HGDIOBJ WINAPI DeleteObjectEx | ( | HGDIOBJ | hObj | ) |
Delete a GDI object and return NULL on success, else hObj.
Definition at line 290 of file GdiUtil.cpp.
void WINAPI Line | ( | HDC | hdc, |
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2 | ||
) |
Draw a line, using the current pen.
(Simply combines MoveToEx and LineTo.)
Definition at line 506 of file GdiUtil.cpp.
void WINAPI DrawIsoTriangle | ( | HDC | hdc, |
int | xOrg, | ||
int | yOrg, | ||
int | Radius, | ||
double | Orientation | ||
) |
DrawIsoTriangle() draws an isosceles triangle using the current pen and brush.
See GetIsoTriangleVertices() for parameter details.
Definition at line 529 of file GdiUtil.cpp.
void WINAPI GetIsoTriangleVertices | ( | POINT * | Vtx, |
int | xOrg, | ||
int | yOrg, | ||
int | Radius, | ||
double | Orientation | ||
) |
GetIsoTriangleVertices() computes the vertices of an isosceles triangle.
Vtx | [out] Three POINT array that recieves the vertices. |
xOrg | Circumcenter x coordinate. |
yOrg | Circumcenter y coordinate. |
Radius | Distance from circumcenter to vertices. |
Orientation | Direction to first vertex, in radians. |
Definition at line 512 of file GdiUtil.cpp.