⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 gdi.h

📁 usoc在北京博创兴业有限公司的实验平台s3c2410上运行。 2. 各实验的全部源代码分别存放在各实验目录下面。
💻 H
📖 第 1 页 / 共 5 页
字号:
 *      - DC_ATTR_PEN_COLOR\n *        Pen color. *      - DC_ATTR_BRUSH_TYPE\n *        Brush type. *      - DC_ATTR_BRUSH_COLOR\n *        Brush color. *      - DC_ATTR_TEXT_COLOR\n *        Text color. *      - DC_ATTR_TAB_STOP\n *        Tabstop width. * * \return The attribute value. * * \note Only defined for _USE_NEWGAL. * * \sa SetDCAttr */Uint32 GUIAPI GetDCAttr (HDC hdc, int attr);/** * \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);/** * \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 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 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 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 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);gal_pixel GUIAPI SetPenColor (HDC hdc, gal_pixel color);gal_pixel GUIAPI SetBrushColor (HDC hdc, gal_pixel color);#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 entries of a DC. * * This function sets some palette entries of the DC \a hdc. * * \param hdc The device context. * \param start The start entry of palette to be set. * \param len The length of entries to be set. * \param cmap Pointer to the palette entries. * \return TRUE on success, otherwise FALSE. * * \sa GetPalette */BOOL GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);/** * \fn BOOL GUIAPI SetColorfulPalette (HDC hdc) * \brief Sets a DC with colorfule palette. * * This function sets the DC specified by \a hdc with colorful palette. * * \param hdc The device context. * \return TRUE on success, otherwise FALSE. * * \sa SetPalette */BOOL GUIAPI SetColorfulPalette (HDC hdc);#elseint GUIAPI GetPalette (HDC hdc, int start, int len, GAL_Color* cmap);int GUIAPI SetPalette (HDC hdc, int start, int len, GAL_Color* cmap);int GUIAPI SetColorfulPalette (HDC hdc);#endif /* _USE_NEWGAL */    /** @} end of pal_fns */    /**     * \defgroup draw_fns General drawing functions     * @{     */#ifdef _USE_NEWGAL/** * \fn void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel) * \brief Sets the pixel with a new pixel value at the specified position on a DC. * * This function sets the pixel with a pixel value \a pixel at the specified position \a (x,y)  * on the DC \a hdc. You can the pre-defined standard system pixel values. * * \param hdc The device context. * \param x x,y: The pixel position. * \param y x,y: The pixel position. * \param pixel The pixel value. * * \sa GetPixel, color_vars */void GUIAPI SetPixel (HDC hdc, int x, int y, gal_pixel pixel);/** * \fn gal_pixel GUIAPI SetPixelRGB (HDC hdc, int x, int y, Uint8 r, Uint8 g, Uint8 b) * \brief Sets the pixel by a RGB triple at the specified position on a DC. * * This function sets the pixel with a RGB triple \a (r,g,b) at the specified position \a (x,y)  * on the DC \a hdc. * * \param hdc The device context. * \param x 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -