📄 gdi.h
字号:
/** * \fn Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value) * \brief Sets a specified attribute value of a DC. * * This function sets a specified attribute value of the DC \a hdc. * * \param hdc The device context. * \param attr The attribute to be set. * \param value The attribute value. * \return The old attribute value. * * \note Only defined for _USE_NEWGAL. * * \sa GetDCAttr */Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value);#define DC_ATTR_BK_COLOR 0#define DC_ATTR_BK_MODE 1#define DC_ATTR_PEN_TYPE 2#define DC_ATTR_PEN_COLOR 3#define DC_ATTR_BRUSH_TYPE 4#define DC_ATTR_BRUSH_COLOR 5#define DC_ATTR_TEXT_COLOR 6#define DC_ATTR_TAB_STOP 7/** * \def GetBkColor(hdc) * \brief Gets the background color of a DC. * * \param hdc The device context. * \return The background pixel value of the DC \a hdc. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetBkColor is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetBkColor */#define GetBkColor(hdc) (gal_pixel) GetDCAttr (hdc, DC_ATTR_BK_COLOR)/** * \def GetBkMode(hdc) * \brief Gets the background mode of a DC. * * \param hdc The device context. * \return The background mode of the DC \a hdc. * * \retval BM_TRANSPARENT Indicate that reserve the background untouched when draw text. * \retval BM_OPAQUE Indicate that erase the background with background color when draw text. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetBkMode is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetBkMode */#define GetBkMode(hdc) (int) GetDCAttr (hdc, DC_ATTR_BK_MODE)/** * \def GetPenType(hdc) * \brief Gets the pen type of a DC. * * \param hdc The device context. * \return The pen type of the DC \a hdc. * * \retval PT_SOLID Only solid pen type supported so far. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetPenType is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetPenType */#define GetPenType(hdc) (int) GetDCAttr (hdc, DC_ATTR_PEN_TYPE)/** * \def GetPenColor(hdc) * \brief Gets the pen color of a DC. * * \param hdc The device context. * \return The pen color (pixel value) of the DC \a hdc. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetPenColor is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetPenColor */#define GetPenColor(hdc) (gal_pixel) GetDCAttr (hdc, DC_ATTR_PEN_COLOR)/** * \def GetBrushType(hdc) * \brief Gets the brush type of a DC. * * \param hdc The device context. * \return The brush type of the DC \a hdc. * * \retval BT_SOLID Only solid brush type supported so far. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetBrushType is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetBrushType */#define GetBrushType(hdc) (int) GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)/** * \def GetBrushColor(hdc) * \brief Gets the brush color of a DC. * * \param hdc The device context. * \return The brush color (pixel value) of the DC \a hdc. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetBrushColor is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetBrushColor */#define GetBrushColor(hdc) (gal_pixel) GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)/** * \def GetTextColor(hdc) * \brief Gets the text color of a DC. * * \param hdc The device context. * \return The text color (pixel value) of the DC \a hdc. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetTextColor is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetTextColor */#define GetTextColor(hdc) (gal_pixel) GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)/** * \def GetTabStop(hdc) * \brief Gets the tabstop value of a DC. * * \param hdc The device context. * \return The tabstop value of the DC \a hdc. * * \note Defined as a macro calling \a GetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a GetTabStop is defined as * a function, and have the same semantics as this macro. * * \sa GetDCAttr, SetTabStop */#define GetTabStop(hdc) (int) GetDCAttr (hdc, DC_ATTR_TAB_STOP)/** * \def SetBkColor(hdc, color) * \brief Sets the background color of a DC to a new value. * * \param hdc The device context. * \param color The new background color (pixel value). * \return The old background pixel value of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetBkColor is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetBkColor */#define SetBkColor(hdc, color) (gal_pixel) SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)/** * \def SetBkMode(hdc, mode) * \brief Sets the background color of a DC to a new mode. * * \param hdc The device context. * \param mode The new background mode, be can one of the following values: * * - BM_TRANSPARENT\n * Indicate that reserve the background untouched when draw text. * - BM_OPAQUE\n * Indicate that erase the background with background color when draw text. * * \return The old background mode of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetBkMode is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetBkMode */#define SetBkMode(hdc, mode) (int) SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)/** * \def SetPenType(hdc, type) * \brief Sets the pen type of a DC to a new type. * * \param hdc The device context. * \param type The new pen type. Only \a PT_SOLID is supported so far. * \return The old pen type of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetPenType is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetPenType */#define SetPenType(hdc, type) (int) SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)/** * \def SetPenColor(hdc, color) * \brief Sets the pen color of a DC to a new value. * * \param hdc The device context. * \param color The new pen color (pixel value). * \return The old pen pixel value of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetPenColor is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetPenColor */#define SetPenColor(hdc, color) (gal_pixel) SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)/** * \def SetBrushType(hdc, type) * \brief Sets the brush type of a DC to a new type. * * \param hdc The device context. * \param type The new brush type. Only \a BT_SOLID is supported so far. * \return The old brush type of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetBrushType is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetBrushType */#define SetBrushType(hdc, type) (int) SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)/** * \def SetBrushColor(hdc, color) * \brief Sets the brush color of a DC to a new value. * * \param hdc The device context. * \param color The new brush color (pixel value). * \return The old brush pixel value of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetBrushColor is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetBrushColor */#define SetBrushColor(hdc, color) (gal_pixel) SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)/** * \def SetTextColor(hdc, color) * \brief Sets the text color of a DC to a new value. * * \param hdc The device context. * \param color The new text color (pixel value). * \return The old text color (pixel value) of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetTextColor is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetTextColor */#define SetTextColor(hdc, color) (gal_pixel) SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)/** * \def SetTabStop(hdc, value) * \brief Sets the tabstop of a DC to a new value. * * \param hdc The device context. * \param value The new tabstop value in pixels. * \return The old tabstop value in pixels of the DC \a hdc. * * \note Defined as a macro calling \a SetDCAttr for _USE_NEWGAL. * If _USE_NEWGAL is not defined, \a SetTabStop is defined as * a function, and have the same semantics as this macro. * * \sa SetDCAttr, GetTabStop */#define SetTabStop(hdc, value) (int) SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)#define ROP_SET 0#define ROP_AND 1#define ROP_OR 2#define ROP_XOR 3/** * \fn int GUIAPI GetRasterOperation (HDC hdc) * \brief Gets the raster operation of a DC. * * This function gets the raster operation of the DC \a hdc. * * \param hdc The device context. * \return The current raster operation of the DC \a hdc. * * \retval ROP_SET Set to the new pixel value, erase original pixel on the surface. * \retval ROP_AND AND'd the new pixel value with the original pixel on the surface. * \retval ROP_OR OR'd the new pixel value with the original pixel on the surface. * \retval ROP_XOR XOR'd the new pixel value with the original pixel on the surface. * * \note Only defined for _USE_NEWGAL. * * \sa SetRasterOperation */int GUIAPI GetRasterOperation (HDC hdc);/** * \fn int GUIAPI SetRasterOperation (HDC hdc, int rop) * \brief Sets the raster operation of a DC to a new value. * * This function sets the raster operation of the DC \a hdc to the new value \a rop. * * \param hdc The device context. * \param rop The new raster operation, can be one of the following values: * * - ROP_SET\n * Set to the new pixel value, erase original pixel on the surface. * - ROP_AND\n * AND'd the new pixel value with the original pixel on the surface. * - ROP_OR\n * OR'd the new pixel value with the original pixel on the surface. * - ROP_XOR\n * XOR'd the new pixel value with the original pixel on the surface. * * \return The old raster operation of the DC \a hdc. * * \note Only defined for _USE_NEWGAL. * * \sa GetRasterOperation */int GUIAPI SetRasterOperation (HDC hdc, int rop);#elsegal_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 */gal_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);#endif /* _USE_NEWGAL */ /** @} end of dc_attrs */ /** * \defgroup pal_fns Palette operations * @{ */#ifdef _USE_NEWGAL/** * \fn BOOL GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap) * \brief Gets palette entries of a DC. * * This function gets some palette entries of the DC \a hdc. * * \param hdc The device context. * \param start The start entry of palette to be retrived. * \param len The length of entries to be retrived. * \param cmap The buffer receives the palette entries. * \return TRUE on success, otherwise FALSE. * * \sa SetPalette */BOOL GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);/** * \fn BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap) * \brief Sets palette ent
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -