MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Data Structures | Macros | Typedefs | Enumerations | Functions
Advanced 2-Dimension graphics functions.

Data Structures

struct  _STIPPLE
 
struct  _ARC
 

Macros

#define GetPenType(hdc)   GetDCAttr (hdc, DC_ATTR_PEN_TYPE)
 Get the pen type of a DC. More...
 
#define SetPenType(hdc, type)   SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)
 Set the pen type of a DC to a new type. More...
 
#define GetPenCapStyle(hdc)   GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)
 Get the pen cap style of a DC. More...
 
#define SetPenCapStyle(hdc, style)   SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)
 Set the pen type of a DC to a new type. More...
 
#define GetPenJoinStyle(hdc)   GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)
 Get the pen join style of a DC. More...
 
#define SetPenJoinStyle(hdc, style)   SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)
 Set the pen type of a DC to a new type. More...
 
#define GetPenWidth(hdc)   GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)
 Get the pen width of a DC. More...
 
#define SetPenWidth(hdc, width)   SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)
 Set the pen width of a DC to a new width. More...
 
#define GetBrushType(hdc)   GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)
 Get the brush type of a DC. More...
 
#define SetBrushType(hdc, type)   SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)
 Set the brush type of a DC to a new type. More...
 

Typedefs

typedef struct _STIPPLE STIPPLE
 
typedef struct _ARC ARC
 

Enumerations

enum  PenType { PT_SOLID, PT_ON_OFF_DASH, PT_DOUBLE_DASH }
 
enum  PTCapStyle { PT_CAP_BUTT, PT_CAP_ROUND, PT_CAP_PROJECTING }
 
enum  PTJoinStyle { PT_JOIN_MITER, PT_JOIN_ROUND, PT_JOIN_BEVEL }
 
enum  BrushType { BT_SOLID, BT_TILED, BT_STIPPLED, BT_OPAQUE_STIPPLED }
 

Functions

MG_EXPORT void GUIAPI SetPenDashes (HDC hdc, int dash_offset, const unsigned char *dash_list, int n)
 Set the way dashed-lines are drawn. More...
 
MG_EXPORT void GUIAPI SetBrushInfo (HDC hdc, const BITMAP *tile, const STIPPLE *stipple)
 Set the tile or stipple with the DC. More...
 
MG_EXPORT void GUIAPI SetBrushOrigin (HDC hdc, int x, int y)
 Set the origin when using tiles or stipples with the DC. More...
 
MG_EXPORT void GUIAPI LineEx (HDC hdc, int x1, int y1, int x2, int y2)
 Draws a line with the current pen in the DC hdc. More...
 
MG_EXPORT void GUIAPI ArcEx (HDC hdc, int x, int y, int width, int height, int ang1, int ang2)
 Draws an arc with the current pen in a DC. More...
 
MG_EXPORT void GUIAPI FillArcEx (HDC hdc, int x, int y, int width, int height, int ang1, int ang2)
 Fills an arc with the current brush in a DC. More...
 
MG_EXPORT void GUIAPI PolyLineEx (HDC hdc, const POINT *pts, int nr_pts)
 Draws a polyline with the current pen in a DC. More...
 
MG_EXPORT void GUIAPI PolyArcEx (HDC hdc, const ARC *arcs, int nr_arcs)
 Draws a polyarc with the current pen in a DC. More...
 
MG_EXPORT void GUIAPI PolyFillArcEx (HDC hdc, const ARC *arcs, int nr_arcs)
 Fill a polyarc with the current brush in a DC. More...
 
MG_EXPORT BOOL GUIAPI RoundRect (HDC hdc, int x0, int y0, int x1, int y1, int cw, int ch)
 Draw and fill a rectangle with rounded corners in a DC. More...
 

Detailed Description

Macro Definition Documentation

◆ GetBrushType

#define GetBrushType (   hdc)    GetDCAttr (hdc, DC_ATTR_BRUSH_TYPE)

Get the brush type of a DC.

Parameters
hdcThe device context.
Returns
The brush type of the DC hdc.
See also
BrushType, GetDCAttr, SetBrushType

Definition at line 4180 of file gdi.h.

◆ GetPenCapStyle

#define GetPenCapStyle (   hdc)    GetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE)

Get the pen cap style of a DC.

Parameters
hdcThe device context.
Returns
The pen cap style of the DC hdc.
See also
PTCapStyle, GetDCAttr, SetPenCapStyle

Definition at line 4054 of file gdi.h.

◆ GetPenJoinStyle

#define GetPenJoinStyle (   hdc)    GetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE)

Get the pen join style of a DC.

Parameters
hdcThe device context.
Returns
The pen join style of the DC hdc.
See also
PTJoinStyle, GetDCAttr, SetPenJoinStyle

Definition at line 4099 of file gdi.h.

◆ GetPenType

#define GetPenType (   hdc)    GetDCAttr (hdc, DC_ATTR_PEN_TYPE)

Get the pen type of a DC.

Parameters
hdcThe device context.
Returns
The pen type of the DC hdc.
See also
PenType, GetDCAttr, SetPenType

Definition at line 3985 of file gdi.h.

◆ GetPenWidth

#define GetPenWidth (   hdc)    GetDCAttr (hdc, DC_ATTR_PEN_WIDTH)

Get the pen width of a DC.

Parameters
hdcThe device context.
Returns
The width of the current pen in the DC hdc.
See also
GetDCAttr, SetPenWidth

Definition at line 4123 of file gdi.h.

◆ SetBrushType

#define SetBrushType (   hdc,
  type 
)    SetDCAttr (hdc, DC_ATTR_BRUSH_TYPE, (DWORD) type)

Set the brush type of a DC to a new type.

Parameters
hdcThe device context.
typeThe new brush type.
Returns
The old brush type of the DC hdc.
See also
BrushType, SetDCAttr, GetBrushType

Definition at line 4193 of file gdi.h.

◆ SetPenCapStyle

#define SetPenCapStyle (   hdc,
  style 
)    SetDCAttr (hdc, DC_ATTR_PEN_CAP_STYLE, (DWORD) style)

Set the pen type of a DC to a new type.

Parameters
hdcThe device context.
styleThe new pen cap style.
Returns
The old pen cap style of the DC hdc.
See also
PTCapStyle, SetDCAttr, GetPenCapStyle

Definition at line 4067 of file gdi.h.

◆ SetPenJoinStyle

#define SetPenJoinStyle (   hdc,
  style 
)    SetDCAttr (hdc, DC_ATTR_PEN_JOIN_STYLE, (DWORD) style)

Set the pen type of a DC to a new type.

Parameters
hdcThe device context.
styleThe new pen join style.
Returns
The old pen join style of the DC hdc.
See also
PTJoinStyle, SetDCAttr, GetPenJoinStyle

Definition at line 4111 of file gdi.h.

◆ SetPenType

#define SetPenType (   hdc,
  type 
)    SetDCAttr (hdc, DC_ATTR_PEN_TYPE, (DWORD) type)

Set the pen type of a DC to a new type.

Parameters
hdcThe device context.
typeThe new pen type.
Returns
The old pen type of the DC hdc.
See also
PenType, SetDCAttr, GetPenType

Definition at line 3998 of file gdi.h.

◆ SetPenWidth

#define SetPenWidth (   hdc,
  width 
)    SetDCAttr (hdc, DC_ATTR_PEN_WIDTH, (DWORD) width)

Set the pen width of a DC to a new width.

Parameters
hdcThe device context.
widthThe new pen width.
Returns
The old pen width of the DC hdc.
See also
SetDCAttr, GetPenWidth

Definition at line 4136 of file gdi.h.

Typedef Documentation

◆ ARC

typedef struct _ARC ARC

Arc structure.

◆ STIPPLE

typedef struct _STIPPLE STIPPLE

The stipple bitmap structure.

Enumeration Type Documentation

◆ BrushType

enum BrushType

DC brush types. Solid: Tiled: Stippled: OpaqueStippled:

Enumerator
BT_SOLID 

Draw with the current brush color.

BT_TILED 

Draw with a tiled bitmap.

BT_STIPPLED 

Draw using the stipple bitmap. Pixels corresponding to bits in the stipple bitmap that are set will be drawn in the brush color; pixels corresponding to bits that are not set will be left untouched.

BT_OPAQUE_STIPPLED 

Draw using the stipple bitmap. Pixels corresponding to bits in the stipple bitmap that are set will be drawn in the brush color; pixels corresponding to bits that are not set will be drawn with the background color.

Definition at line 4146 of file gdi.h.

◆ PenType

enum PenType

DC Line styles

Enumerator
PT_SOLID 

The solid pen. We call the solid pen with zero wide as "zero pen".

PT_ON_OFF_DASH 

The on/off dash pen, even segments are drawn; odd segments are not drawn.

PT_DOUBLE_DASH 

The double dash pen, even segments are normally. Odd segments are drawn in the brush color if the brush type is BT_SOLID, or in the brush color masked by the stipple if the brush type is BT_STIPPLED.

Definition at line 3955 of file gdi.h.

◆ PTCapStyle

enum PTCapStyle

DC Line cap styles

Enumerator
PT_CAP_BUTT 

The ends of the lines are drawn squared off and extending to the coordinates of the end point.

PT_CAP_ROUND 

The ends of the lines are drawn as semicircles with the diameter equal to the line width and centered at the end point.

PT_CAP_PROJECTING 

The ends of the lines are drawn squared off and extending half the width of the line beyond the end point.

Definition at line 4026 of file gdi.h.

◆ PTJoinStyle

DC Line join styles

Enumerator
PT_JOIN_MITER 

The sides of each line are extended to meet at an angle.

PT_JOIN_ROUND 

The sides of the two lines are joined by a circular arc.

PT_JOIN_BEVEL 

The sides of the two lines are joined by a straight line which makes an equal angle with each line.

Definition at line 4073 of file gdi.h.

Function Documentation

◆ ArcEx()

void GUIAPI ArcEx ( HDC  hdc,
int  x,
int  y,
int  width,
int  height,
int  ang1,
int  ang2 
)

Draws an arc with the current pen in a DC.

This function draws an arc with the current pen in the DC hdc. The coordinates of the upper-left corner of the bounding rectanglecenter of the arc is (x, y), the bounding box of the arc is width wide and height high, and the degree of start angle and end angle are ang1 and ang2 respectively.

Parameters
hdcThe device context.
xThe x coordinate of the left edge of the bounding rectangle.
yThe y coordinate of the left edge of the bounding rectangle.
widthThe width of the bounding box of the arc.
heightThe height of the bounding box of the arc.
ang1The start angle of the arc, relative to the 3 o'clock position, counter-clockwise, in 1/64ths of a degree.
ang2The end angle of the arc, relative to angle1, in 1/64ths of a degree.
See also
DC attribute operations

◆ FillArcEx()

void GUIAPI FillArcEx ( HDC  hdc,
int  x,
int  y,
int  width,
int  height,
int  ang1,
int  ang2 
)

Fills an arc with the current brush in a DC.

This function fills an arc with the current brush in the DC hdc. The coordinates of the upper-left corner of the bounding rectanglecenter of the arc is (x, y), the bounding box of the arc is width wide and height high, and the degree of start angle and end angle are ang1 and ang2 respectively.

Parameters
hdcThe device context.
xThe x coordinate of the left edge of the bounding rectangle.
yThe y coordinate of the left edge of the bounding rectangle.
widthThe width of the bounding box of the arc.
heightThe height of the bounding box of the arc.
ang1The start angle of the arc, relative to the 3 o'clock position, counter-clockwise, in 1/64ths of a degree.
ang2The end angle of the arc, relative to angle1, in 1/64ths of a degree.
See also
ArcEx, DC attribute operations

◆ LineEx()

void GUIAPI LineEx ( HDC  hdc,
int  x1,
int  y1,
int  x2,
int  y2 
)

Draws a line with the current pen in the DC hdc.

This function draws a line with the current pen in the DC hdc. The line draws from (x1, y1) to (x2, y2).

Parameters
hdcThe device context.
x1x1,y1: The start point of the line.
y1x1,y1: The start point of the line.
x2x2,y2: The end point of the line.
y2x2,y2: The end point of the line.
Note
This function does not change the pen position.
See also
LineTo, DC attribute operations

◆ PolyArcEx()

void GUIAPI PolyArcEx ( HDC  hdc,
const ARC arcs,
int  nr_arcs 
)

Draws a polyarc with the current pen in a DC.

This function draws a polyarc with the current pen in the DC hdc.

Parameters
hdcThe device context.
arcsThe pointer to an ARC array which defines the arcs.
nr_arcsThe number of the arcs.
See also
ArcEx

◆ PolyFillArcEx()

void GUIAPI PolyFillArcEx ( HDC  hdc,
const ARC arcs,
int  nr_arcs 
)

Fill a polyarc with the current brush in a DC.

This function fill a polyarc with the current brush in the DC hdc.

Parameters
hdcThe device context.
arcsThe pointer to an ARC array which defines the arcs.
nr_arcsThe number of the arcs.
See also
ArcEx

◆ PolyLineEx()

void GUIAPI PolyLineEx ( HDC  hdc,
const POINT pts,
int  nr_pts 
)

Draws a polyline with the current pen in a DC.

This function draws a polyline with the current pen in the DC hdc.

Parameters
hdcThe device context.
ptsThe pointer to the vertex array of the polyline.
nr_ptsThe number of the vertices.
See also
LineEx

◆ RoundRect()

BOOL GUIAPI RoundRect ( HDC  hdc,
int  x0,
int  y0,
int  x1,
int  y1,
int  rw,
int  rh 
)

Draw and fill a rectangle with rounded corners in a DC.

This function draws a rectangle with rounded corners. The rectangle is outlined by using the current pen and filled by using the current brush in the DC hdc.

Parameters
hdcThe device context.
x0The x-coordinate of the upper-left corner of the rectangle.
y0The y-coordinate of the upper-left corner of the rectangle.
x1The x-coordinate of the lower-right corner of the rectangle.
y1The y-coordinate of the lower-right corner of the rectangle.
rwThe x-radius of the rounded corners.
rhThe y-radius of the rounded corners.
Returns
TRUE for visible, else for not.
See also
ArcEx, LineEx, FillArcEx, FillBox

◆ SetBrushInfo()

void GUIAPI SetBrushInfo ( HDC  hdc,
const BITMAP tile,
const STIPPLE stipple 
)

Set the tile or stipple with the DC.

Parameters
hdcThe device context.
tileThe tile bitmap.
stippleThe stipple bitmap.
See also
SetBrushInfo

◆ SetBrushOrigin()

void GUIAPI SetBrushOrigin ( HDC  hdc,
int  x,
int  y 
)

Set the origin when using tiles or stipples with the DC.

Set the origin when using tiles or stipples with the DC. The tile or stipple will be aligned such that the upper left corner of the tile or stipple will coincide with this point.

Parameters
hdcThe device context.
xThe x-coordinate of the origin.
yThe y-coordinate of the origin.
See also
SetBrushInfo

◆ SetPenDashes()

void SetPenDashes ( HDC  hdc,
int  dash_offset,
const unsigned char *  dash_list,
int  n 
)

Set the way dashed-lines are drawn.

Set the way dashed-lines are drawn. Lines will be drawn with alternating on and off segments of the lengths specified in dash_list. The manner in which the on and off segments are drawn is determined by the pen type of the DC. (This can be changed with SetPenType function.)

Parameters
hdcThe device context.
dash_offsetThe offset in the dash list.
dash_listThe dash list.
nThe lenght of the dash list.
Returns
The old pen type of the DC hdc.
See also
SetPenType