3 Functions of NB-Designer
3-276
NB-series Programmable Terminals NB-Designer Operation Manual(V106)
6
Supports Direct Drawing in the Screen (Description of PT Drawing Function)
The Macro executing function allows the user to call drawing function.
Drawing functions adopt rectangular coordinate system of screen: point of origin locates in the
upper-left corner, and the X-axis extends rightward while the Y-axis extends downward.
(1) Definition of Struct
Add 3 structs: PenParam, BrushParam and Point.
(a) Pen structure “PenParam”
typedef struct penparam
{
short type;
short width;
int color;
}PenParam;
PenParam is mainly used to set the type, width and the color Properties of the pen.
And the value range is as follows.
(b) Brush Structure “BrushParam”
typedef struct brushparam
{
int type;
int foreColor;
int backColor;
}BrushParam;
BrushParam is mainly used to set the type of the brush, the foreground color and
background color. Brush type is mainly used to set the filling styles used by the brush:
graphics-filling and gradient-filling. And the value range is as follows.
Parameter Name Value Descriptions
Type (Pen type) PS_NULL No pen
PS_SOLID Smooth line ( )
PS_DASH Dash line ( )
PS_DOT Dot line ( )
PS_DASHDOT Dash-dotted line ( )
PS_DASHDOTDOT Dot-dotted line ( )
Width (Pen Size) 1~8 (Unit: pixel) If the input value is less than the minimum value 1 or greater
than the maximum value 8, the system will automatically set it
to the minimum value or the maximum value respectively.
Color (Pen Color) 0~65535 It is recommended to use Macro RGB (r. g. b) to set the color,
and the range for r, g and b is 0~255. The system will convert
the value of RGB (r, g, b) according to the color parameters of
PT screen.
Parameter Name Value Descriptions
Type (Brush type) BFS_NOBRUSH No filling
BFS_SOLID
BFS_DENSE1