?? gdi.h
字號:
#define PIXEL_cyan SysPixelIndex[14]#define PIXEL_lightwhite SysPixelIndex[15]#define PIXEL_black SysPixelIndex[16]// Compatiblity definitions#define COLOR_invalid PIXEL_invalid#define COLOR_transparent PIXEL_transparent#define COLOR_darkred PIXEL_darkred#define COLOR_darkgreen PIXEL_darkgreen#define COLOR_darkyellow PIXEL_darkyellow#define COLOR_darkblue PIXEL_darkbule#define COLOR_darkmagenta PIXEL_darkmagenta#define COLOR_darkcyan PIXEL_darkcyan#define COLOR_lightgray PIXEL_lightgray#define COLOR_darkgray PIXEL_darkgray#define COLOR_red PIXEL_red#define COLOR_green PIXEL_green#define COLOR_yellow PIXEL_yellow#define COLOR_blue PIXEL_blue#define COLOR_magenta PIXEL_magenta#define COLOR_cyan PIXEL_cyan#define COLOR_lightwhite PIXEL_lightwhite#define COLOR_black PIXEL_black#define SysColorIndex SysPixelIndex#define SCREENHDC 0#define HDC_SCREEN SCREENHDC#define HDC_INVALID 0#define GDCAP_COLORNUM 0#define GDCAP_HPIXEL 1#define GDCAP_VPIXEL 2#define GDCAP_MAXX 3#define GDCAP_MAXY 4#define GDCAP_DEPTH 5#define GDCAP_BPP 6int GUIAPI GetGDCapability (HDC hdc, int iItem);// Get and release DCHDC GUIAPI GetDC (HWND hwnd);HDC GUIAPI GetClientDC (HWND hwnd);void GUIAPI ReleaseDC (HDC hdc);HDC GUIAPI CreateCompatibleDC (HDC hdc);void GUIAPI DeleteCompatibleDC (HDC hdc);HDC GUIAPI CreatePrivateDC (HWND hwnd);HDC GUIAPI CreatePrivateClientDC (HWND hwnd);HDC GUIAPI GetPrivateClientDC (HWND hwnd);void GUIAPI DeletePrivateDC (HDC hdc);// General drawing attributes#define BM_TRANSPARENT 1#define BM_OPAQUE 0gal_pixel GUIAPI GetBkColor (HDC hdc);int GUIAPI GetBkMode (HDC hdc);gal_pixel GUIAPI GetTextColor (HDC hdc);gal_pixel GUIAPI SetBkColor (HDC hdc, gal_pixel color);int GUIAPI SetBkMode (HDC hdc, int bkmode);gal_pixel GUIAPI SetTextColor (HDC hdc, gal_pixel color);int GUIAPI GetTabStop (HDC hdc);int GUIAPI SetTabStop (HDC hdc, int new_value);// Pen and brush support#define PT_SOLID 0#define BT_SOLID 0gal_pixel GUIAPI GetPenColor (HDC hdc);gal_pixel GUIAPI GetBrushColor (HDC hdc);int GUIAPI GetPenType (HDC hdc);int GUIAPI GetBrushType (HDC hdc);gal_pixel GUIAPI SetPenColor (HDC hdc, gal_pixel color);gal_pixel GUIAPI SetBrushColor (HDC hdc, gal_pixel color);int GUIAPI SetPenType (HDC hdc, int pentype);int GUIAPI SetBrushType (HDC hdc, int brushtype);// General drawing supportvoid GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel c);void GUIAPI SetPixelRGB (HDC hdc, int x, int y, int r, int g, int b);gal_pixel GUIAPI GetPixel (HDC hdc, int x, int y);void GUIAPI GetPixelRGB (HDC hdc, int x, int y, int* r, int* g, int* b);gal_pixel GUIAPI RGB2Pixel (HDC hdc, int r, int g, int b);#define RGB2Index RGB2Pixelvoid GUIAPI LineTo (HDC hdc, int x, int y);void GUIAPI MoveTo (HDC hdc, int x, int y);void GUIAPI Circle (HDC hdc, int x, int y, int r);void GUIAPI Rectangle (HDC hdc, int x0, int y0, int x1, int y1);void GUIAPI FocusRect (HDC hdc, int x0, int y0, int x1, int y1);// Mapping suport #define MM_TEXT 0#define MM_ANISOTROPIC 1int GUIAPI GetMapMode (HDC hdc);void GUIAPI GetViewportExt (HDC hdc, POINT* pPt);void GUIAPI GetViewportOrg (HDC hdc, POINT* pPt);void GUIAPI GetWindowExt (HDC hdc, POINT* pPt);void GUIAPI GetWindowOrg (HDC hdc, POINT* pPt);void GUIAPI SetMapMode (HDC hdc, int mapmode);void GUIAPI SetViewportExt (HDC hdc, POINT* pPt);void GUIAPI SetViewportOrg (HDC hdc, POINT* pPt);void GUIAPI SetWindowExt (HDC hdc, POINT* pPt);void GUIAPI SetWindowOrg (HDC hdc, POINT* pPt);// Coordinate system transfervoid GUIAPI DPtoLP (HDC hdc, POINT* pPt);void GUIAPI LPtoDP (HDC hdc, POINT* pPt);// Clipping supportvoid GUIAPI ExcludeClipRect (HDC hdc, int left, int top, int right, int bottom);void GUIAPI IncludeClipRect (HDC hdc, int left, int top, int right, int bottom);void GUIAPI ClipRectIntersect (HDC hdc, const RECT* prc);void GUIAPI SelectClipRect (HDC hdc, const RECT* prc);void GUIAPI SelectClipRegion (HDC hdc, const CLIPRGN* pRgn);void GUIAPI GetBoundsRect (HDC hdc, RECT* pRect);BOOL GUIAPI PtVisible (HDC hdc, const POINT* pPt);BOOL GUIAPI RectVisible (HDC hdc, const RECT* pRect);// Bitmap supportvoid GUIAPI SaveScreenBox (int x, int y, int w, int h, void* vbuf);void* GUIAPI SaveCoveredScreenBox (int x, int y, int w, int h);#ifdef _MISC_SAVESCREENBOOL GUIAPI SaveMainWindowContent (HWND hWnd, const char* filename);#endifvoid GUIAPI PutSavedBoxOnScreen (int x, int y, int w, int h, void* vbuf);void GUIAPI PutSavedBoxOnDC (HDC hdc, int x, int y, int w, int h, void* vbuf);void GUIAPI ScreenCopy (int sx, int sy, HDC hdc, int dx, int dy);void GUIAPI FillBox (HDC hdc, int x, int y, int w, int h);void GUIAPI FillBoxWithBitmap (HDC hdc, int x, int y, int w, int h, PBITMAP pBitmap);void GUIAPI FillBoxWithBitmapPart (HDC hdc, int x, int y, int w, int h, int bw, int bh, PBITMAP pBitmap, int xo, int yo);void GUIAPI BitBlt (HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, DWORD dwRop);void GUIAPI StretchBlt (HDC hsdc, int sx, int sy, int sw, int sh, HDC hddc, int dx, int dy, int dw, int dh, DWORD dwRop);// Icon supportHICON GUIAPI LoadIconFromFile (HDC hdc, const char* filename, int which);HICON GUIAPI CreateIcon (HDC hdc, int w, int h, const BYTE* AndBits, const BYTE* XorBits, int colornum);BOOL GUIAPI DestroyIcon (HICON hicon);void GUIAPI DrawIcon (HDC hdc, int x, int y, int w, int h, HICON hicon);// Rectangle support void GUIAPI SetRect (RECT* prc, int left, int top, int right, int bottom);void GUIAPI SetRectEmpty (RECT* prc);void GUIAPI CopyRect (RECT* pdrc, const RECT* psrc);BOOL GUIAPI IsRectEmpty (const RECT* prc);BOOL GUIAPI EqualRect (const RECT* prc1, const RECT* prc2);void GUIAPI NormalizeRect (RECT* pRect);BOOL GUIAPI IntersectRect (RECT* pdrc, const RECT* psrc1, const RECT* psrc2);BOOL GUIAPI IsCovered (const RECT* prc1, const RECT* prc2);BOOL GUIAPI DoesIntersect (const RECT* psrc1, const RECT* psrc2);BOOL GUIAPI UnionRect (RECT* pdrc, const RECT* psrc1, const RECT* psrc2);void GUIAPI GetBoundRect (PRECT pdrc, const RECT* psrc1, const RECT* psrc2);int GUIAPI SubtractRect (RECT* rc, const RECT* psrc1, const RECT* psrc2);void GUIAPI OffsetRect (RECT* prc, int x, int y);void GUIAPI InflateRect (RECT* prc, int cx, int cy);void GUIAPI InflateRectToPt (RECT* prc, int x, int y);BOOL GUIAPI PtInRect (const RECT* prc, int x, int y);#define RECTWP(prc) (prc->right - prc->left)#define RECTHP(prc) (prc->bottom - prc->top)#define RECTW(rc) (rc.right - rc.left)#define RECTH(rc) (rc.bottom - rc.top)// System font supportconst char* GUIAPI GetSysCharset (void);BOOL GUIAPI DoesSupportCharset (const char* charset);int GUIAPI SetSysCharset (const char* charset);int GUIAPI GetSysCharWidth (void);int GUIAPI GetSysCCharWidth (void);int GUIAPI GetSysCharHeight (void);void GUIAPI GetSysTabbedTextExtent (const char* spText, SIZE* pSize);// Compatiblity definitions#define GetCharWidth GetSysCharWidth#define GetCCharWidth GetSysCCharWidth#define GetCharHeight GetSysCharHeight// Font support#define INV_LOGFONT 0PLOGFONT GUIAPI CreateLogFont (const char* type, const char* family, const char* charset, char weight, char slant, char set_width, char spacing, char underline, char struckout, int size, int rotation);PLOGFONT GUIAPI CreateLogFontIndirect (LOGFONT* logfont);void GUIAPI DestroyLogFont (PLOGFONT log_font);void GUIAPI GetLogFontInfo (HDC hdc, LOGFONT* log_font);#define SYSLOGFONT_DEFAULT 0PLOGFONT GUIAPI GetSystemFont (int font_id);PLOGFONT GUIAPI GetCurFont (HDC hdc);PLOGFONT GUIAPI SelectFont (HDC hdc, PLOGFONT log_font);// Text parse supportint GUIAPI GetTextMCharInfo (PLOGFONT log_font, const char* mstr, int len, int* pos_chars);int GUIAPI GetTextWordInfo (PLOGFONT log_font, const char* mstr, int len, int* pos_words, WORDINFO* info_words);int GUIAPI GetFirstMCharLen (PLOGFONT log_font, const char* mstr, int len);int GUIAPI GetFirstWord (PLOGFONT log_font, const char* mstr, int len, WORDINFO* word_info);int GUIAPI GetTextExtentPoint (HDC hdc, const char* text, int len, int max_extent, int* fit_chars, int* pos_chars, int* dx_chars, SIZE* size);// Text output supportint GUIAPI GetFontHeight (HDC hdc);int GUIAPI GetMaxFontWidth (HDC hdc);void GUIAPI GetTextExtent (HDC hdc, const char* spText, int len, SIZE* pSize);void GUIAPI GetTabbedTextExtent (HDC hdc, const char* spText, int len, SIZE* pSize);int GUIAPI GetTextCharacterExtra (HDC hdc);int GUIAPI SetTextCharacterExtra (HDC hdc, int extra);int GUIAPI GetTextAboveLineExtra (HDC hdc);int GUIAPI SetTextAboveLineExtra (HDC hdc, int extra);int GUIAPI GetTextBellowLineExtra (HDC hdc);int GUIAPI SetTextBellowLineExtra (HDC hdc, int extra);int GUIAPI TextOutLen (HDC hdc, int x, int y, const char* spText, int len);int GUIAPI TabbedTextOutLen (HDC hdc, int x, int y, const char* spText, int len); int GUIAPI TabbedTextOutEx (HDC hdc, int x, int y, const char* spText, int nCount, int nTabPositions, int *pTabPositions, int nTabOrigin);void GUIAPI GetLastTextOutPos (HDC hdc, POINT* pt);// Compatiblity definitions#define TextOut(hdc, x, y, text) TextOutLen (hdc, x, y, text, -1)#define TabbedTextOut(hdc, x, y, text) TabbedTextOutLen (hdc, x, y, text, -1)#define DT_TOP 0x00000000#define DT_LEFT 0x00000000#define DT_CENTER 0x00000001#define DT_RIGHT 0x00000002#define DT_VCENTER 0x00000004#define DT_BOTTOM 0x00000008#define DT_WORDBREAK 0x00000010#define DT_SINGLELINE 0x00000020#define DT_EXPANDTABS 0x00000040#define DT_TABSTOP 0x00000080#define DT_NOCLIP 0x00000100#define DT_EXTERNALLPADING 0x00000200#define DT_CALCRECT 0x00000400#define DT_NOPREFIX 0x00000800#define DT_INTERNAL 0x00001000int GUIAPI DrawTextEx (HDC hdc, const char* pText, int nCount, RECT* pRect, int nIndent, UINT nFormat);#define DrawText(hdc, text, n, rc, format) DrawTextEx (hdc, text, n, rc, 0, format)/************************** Bitmap file load/save support ******************/#define BMP_FLOW_DOWN 1#define BMP_FLOW_UP 2#define LOADBMP_FLAG_GRAYSCALE 0x00000001#define LOADBMP_FLAG_NONE 0x00000000#define RGB_ORDER_RGB 0#define RGB_ORDER_BGR 1typedef struct tagMYBITMAP{ int depth; int w, h; int size; int pitch; int frames; int flow; int rgb_order; int transparent; BYTE* bits; DWORD flags;} MYBITMAP;#include <stdio.h>BOOL GUIAPI RegisterBitmapFileType (const char *ext, int (*load) (FILE* fp, MYBITMAP *bmp, RGB *pal), int (*save) (FILE* fp, MYBITMAP *bmp, RGB *pal));#define ERR_BMP_OK 0#define ERR_BMP_IMAGE_TYPE -1#define ERR_BMP_UNKNOWN_TYPE -2#define ERR_BMP_CANT_READ -3#define ERR_BMP_CANT_SAVE -4#define ERR_BMP_NOT_SUPPORTED -5 #define ERR_BMP_MEM -6#define ERR_BMP_LOAD -7#define ERR_BMP_FILEIO -8#define ERR_BMP_OTHER -9int GUIAPI LoadBitmap (HDC hdc, PBITMAP pBitmap, const char* spFileName);#ifdef _SAVE_BITMAPint GUIAPI SaveBitmap (HDC hdc, PBITMAP pBitmap, const char* spFileName);#endifvoid GUIAPI UnloadBitmap (PBITMAP pBitmap);void GUIAPI ExpandMonoBitmap (HDC hdc, int w, int h, const BYTE* bits, int bits_flow, int pitch, BYTE* bitmap, int bg, int fg);void GUIAPI Expand16CBitmap (HDC hdc, int w, int h, const BYTE* bits, int bits_flow, int pitch, BYTE* bitmap, RGB* pal);void GUIAPI Expand256CBitmap (HDC hdc, int w, int h, const BYTE* bits, int bits_flow, int pitch, BYTE* bitmap, RGB* pal);void GUIAPI CompileRGBBitmap (HDC hdc, int w, int h, const BYTE* bits, int bits_flow, int pitch, BYTE* bitmap, int rgb_order);void GUIAPI ReplaceBitmapColor (HDC hdc, PBITMAP pBitmap, int iOColor, int iNColor);/*********** old GIF and JPG support routines *******************************/#ifdef _OLD_NATIVE_GIFJPGint GUIAPI CreateBitmapFromGIFFile (HDC hdc, PBITMAP pBitmap, const char* filename);int GUIAPI CreateBitmapFromGIFMemory (HDC hdc, PBITMAP pBitmap, void* buffer, int buffer_length);int GUIAPI CreateBitmapFromJPGFile (HDC hdc, PBITMAP pBitmap, const char* filename);int GUIAPI CreateBitmapFromJPGMemory (HDC hdc, PBITMAP pBitmap, void* buffer, int buffer_length);#endif#ifdef __cplusplus}#endif /* __cplusplus */#endif /* GUI_GDI_H */
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -