MiniGUI API Reference (MiniGUI-Standalone)  v3.2.0
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Macros | Functions
DC attribute operations

Macros

#define GetBkColor(hdc)   GetDCAttr (hdc, DC_ATTR_BK_COLOR)
 Gets the background color of a DC. More...
 
#define GetBkMode(hdc)   GetDCAttr (hdc, DC_ATTR_BK_MODE)
 Gets the background mode of a DC. More...
 
#define GetPenColor(hdc)   GetDCAttr (hdc, DC_ATTR_PEN_COLOR)
 Gets the pen color of a DC. More...
 
#define GetBrushColor(hdc)   GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)
 Gets the brush color of a DC. More...
 
#define GetTextColor(hdc)   GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)
 Gets the text color of a DC. More...
 
#define GetTabStop(hdc)   GetDCAttr (hdc, DC_ATTR_TAB_STOP)
 Gets the tabstop value of a DC. More...
 
#define SetBkColor(hdc, color)   SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)
 Sets the background color of a DC to a new value. More...
 
#define SetBkMode(hdc, mode)   SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)
 Sets the background color of a DC to a new mode. More...
 
#define SetPenColor(hdc, color)   SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)
 Sets the pen color of a DC to a new value. More...
 
#define SetBrushColor(hdc, color)   SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)
 Sets the brush color of a DC to a new value. More...
 
#define SetTextColor(hdc, color)   SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)
 Sets the text color of a DC to a new value. More...
 
#define SetTabStop(hdc, value)   SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)
 Sets the tabstop of a DC to a new value. More...
 

Functions

MG_EXPORT Uint32 GUIAPI GetDCAttr (HDC hdc, int attr)
 Gets a specified attribute value of a DC. More...
 
MG_EXPORT Uint32 GUIAPI SetDCAttr (HDC hdc, int attr, Uint32 value)
 Sets a specified attribute value of a DC. More...
 
MG_EXPORT int GUIAPI GetRasterOperation (HDC hdc)
 Gets the raster operation of a DC. More...
 
MG_EXPORT int GUIAPI SetRasterOperation (HDC hdc, int rop)
 Sets the raster operation of a DC to a new value. More...
 

Detailed Description

Macro Definition Documentation

#define GetBkColor (   hdc)    GetDCAttr (hdc, DC_ATTR_BK_COLOR)

Gets the background color of a DC.

Parameters
hdcThe device context.
Returns
The background pixel value of the DC hdc.
See also
GetDCAttr, SetBkColor

Definition at line 2100 of file gdi.h.

#define GetBkMode (   hdc)    GetDCAttr (hdc, DC_ATTR_BK_MODE)

Gets the background mode of a DC.

Parameters
hdcThe device context.
Returns
The background mode of the DC hdc.
Return values
BM_TRANSPARENTIndicate that reserve the background untouched when drawing text.
BM_OPAQUEIndicate that erase the background with background color when drawing text.
See also
GetDCAttr, SetBkMode

Definition at line 2117 of file gdi.h.

#define GetBrushColor (   hdc)    GetDCAttr (hdc, DC_ATTR_BRUSH_COLOR)

Gets the brush color of a DC.

Parameters
hdcThe device context.
Returns
The brush color (pixel value) of the DC hdc.
See also
GetDCAttr, SetBrushColor

Definition at line 2139 of file gdi.h.

#define GetPenColor (   hdc)    GetDCAttr (hdc, DC_ATTR_PEN_COLOR)

Gets the pen color of a DC.

Parameters
hdcThe device context.
Returns
The pen color (pixel value) of the DC hdc.
See also
GetDCAttr, SetPenColor

Definition at line 2128 of file gdi.h.

#define GetTabStop (   hdc)    GetDCAttr (hdc, DC_ATTR_TAB_STOP)

Gets the tabstop value of a DC.

Parameters
hdcThe device context.
Returns
The tabstop value of the DC hdc.
See also
GetDCAttr, SetTabStop

Definition at line 2161 of file gdi.h.

#define GetTextColor (   hdc)    GetDCAttr (hdc, DC_ATTR_TEXT_COLOR)

Gets the text color of a DC.

Parameters
hdcThe device context.
Returns
The text color (pixel value) of the DC hdc.
See also
GetDCAttr, SetTextColor

Definition at line 2150 of file gdi.h.

#define SetBkColor (   hdc,
  color 
)    SetDCAttr (hdc, DC_ATTR_BK_COLOR, (DWORD) color)

Sets the background color of a DC to a new value.

Parameters
hdcThe device context.
colorThe new background color (pixel value).
Returns
The old background pixel value of the DC hdc.
See also
SetDCAttr, GetBkColor

Definition at line 2173 of file gdi.h.

#define SetBkMode (   hdc,
  mode 
)    SetDCAttr (hdc, DC_ATTR_BK_MODE, (DWORD) mode)

Sets the background color of a DC to a new mode.

Parameters
hdcThe device context.
modeThe new background mode, be can one of the following values:
 - BM_TRANSPARENT\n
   Indicate that reserve the background untouched when drawing text. 
 - BM_OPAQUE\n
   Indicate that erase the background with background color when 
   drawing text.
Returns
The old background mode of the DC hdc.
See also
SetDCAttr, GetBkMode

Definition at line 2193 of file gdi.h.

#define SetBrushColor (   hdc,
  color 
)    SetDCAttr (hdc, DC_ATTR_BRUSH_COLOR, (DWORD) color)

Sets the brush color of a DC to a new value.

Parameters
hdcThe device context.
colorThe new brush color (pixel value).
Returns
The old brush pixel value of the DC hdc.
See also
SetDCAttr, GetBrushColor

Definition at line 2219 of file gdi.h.

#define SetPenColor (   hdc,
  color 
)    SetDCAttr (hdc, DC_ATTR_PEN_COLOR, (DWORD) color)

Sets the pen color of a DC to a new value.

Parameters
hdcThe device context.
colorThe new pen color (pixel value).
Returns
The old pen pixel value of the DC hdc.
See also
SetDCAttr, GetPenColor

Definition at line 2206 of file gdi.h.

#define SetTabStop (   hdc,
  value 
)    SetDCAttr (hdc, DC_ATTR_TAB_STOP, (DWORD) value)

Sets the tabstop of a DC to a new value.

Parameters
hdcThe device context.
valueThe new tabstop value in pixels.
Returns
The old tabstop value in pixels of the DC hdc.
See also
SetDCAttr, GetTabStop

Definition at line 2245 of file gdi.h.

#define SetTextColor (   hdc,
  color 
)    SetDCAttr (hdc, DC_ATTR_TEXT_COLOR, (DWORD) color)

Sets the text color of a DC to a new value.

Parameters
hdcThe device context.
colorThe new text color (pixel value).
Returns
The old text color (pixel value) of the DC hdc.
See also
SetDCAttr, GetTextColor

Definition at line 2232 of file gdi.h.

Function Documentation

Uint32 GUIAPI GetDCAttr ( HDC  hdc,
int  attr 
)

Gets a specified attribute value of a DC.

This function retrieves a specified attribute value of the DC hdc.

Parameters
hdcThe device context.
attrThe attribute to be retrieved, can be one of the following values:
 - DC_ATTR_BK_COLOR\n
   Background color.
 - DC_ATTR_BK_MODE\n
   Background mode.
 - DC_ATTR_PEN_TYPE\n
   Pen type.
 - DC_ATTR_PEN_CAP_STYLE\n
   Cap style of pen.
 - DC_ATTR_PEN_JOIN_STYLE\n
   Join style of pen.
 - 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.
 - DC_ATTR_CHAR_EXTRA\n
   Intercharacter spacing for the DC.
 - DC_ATTR_ALINE_EXTRA\n
   Spacing above line for the DC.
 - DC_ATTR_BLINE_EXTRA\n
   Spacing bellow line for the DC.
 - DC_ATTR_MAP_MODE\n
   mode of a DC.
  - DC_ATTR_TEXT_ALIGN\n
   Text-alignment flags of a DC.
Returns
The attribute value.
See also
SetDCAttr
int GUIAPI GetRasterOperation ( HDC  hdc)

Gets the raster operation of a DC.

This function gets the raster operation of the DC hdc.

Parameters
hdcThe device context.
Returns
The current raster operation of the DC hdc.
Return values
ROP_SETSet to the new pixel value, erase original pixel on the surface.
ROP_ANDAND'd the new pixel value with the original pixel on the surface.
ROP_OROR'd the new pixel value with the original pixel on the surface.
ROP_XORXOR'd the new pixel value with the original pixel on the surface.
ROP_COMPOSITEcall default color composition the new pixel value with the original pixel on the surface.
ROP_COMP_USERUser defined color composition operations.
See also
SetRasterOperation, SetUserCompositionOps
Uint32 GUIAPI SetDCAttr ( HDC  hdc,
int  attr,
Uint32  value 
)

Sets a specified attribute value of a DC.

This function sets a specified attribute value of the DC hdc.

Parameters
hdcThe device context.
attrThe attribute to be set.
valueThe attribute value.
Returns
The old attribute value.
See also
GetDCAttr
int GUIAPI SetRasterOperation ( HDC  hdc,
int  rop 
)

Sets the raster operation of a DC to a new value.

This function sets the raster operation of the DC hdc to the new value rop.

Parameters
hdcThe device context.
ropThe 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.
 - ROP_COMPOSITE\n
   call default color composition operators the new pixel value with the original pixel on the surface.
 - ROP_COMP_USER\n
   call user defined color composition operators the new pixel value with the original pixel on the surface.
Returns
The old raster operation of the DC hdc.
See also
GetRasterOperation, SetUserCompositionOps