background image
Original Author Paul Laughton, 2011
Page 159
De Re BASIC!
stroke-related settings in the paint.
2
STROKE_AND_FILL Geometry and text drawn with this style will be filled and stroked at the
same time, respecting the stroke-related fields on the paint.

If you specify a value other than -1, 0, 1, or 2, then the style is set to 2. If you specify a style of -1, the
style is left unchanged, just as if the style parameter were omitted. If you never set a style, the default
value is 1, FILL.
You can change the stroke weight with commands such as Gr.set.stroke (see below) and the various text
style commands.
Example:
GR.OPEN
! basic usage
GR.COLOR ,0,0,255,2
% opaque blue, stroke and fill
GR.RECT r1, 50,50,100,100
% draw two squares
GR.RECT r2, 100,100,150,150
GR.COLOR 128,255,0,0
% half-transparent red
GR.RECT r3, 75,75,125,125
% draw an overlapping square
GR.RENDER : PAUSE 2000
! advanced usage
GR.GET.VALUE r1, "paint", p
% get index of first Paint
GR.COLOR 255,0,255,0,,p
% change that Paint's color to opaque green
GR.RENDER : PAUSE 2000
% both r1 and r2 change
GR.RECT r4, 125,125,175,175
% use current Paint, unchanged
GR.RENDER : PAUSE 2000
% still draws half-transparent red
GR.CLOSE : END
Gr.set.antialias {{<lexp>}{,<paint_nexp>}}
Turns antialiasing on or off on objects drawn after this command is issued:
If the value of the antialias setting parameter <lexp> is false (0), AntiAlias is turned off.
If the parameter value is true (not zero), AntiAlias is turned on.
If the parameter is omitted, the AntiAlias setting is toggled.
AntiAlias should generally be on. It is on by default.
AntiAlias must be off to draw single-pixel pixels and single-pixel-wide horizontal and vertical lines.
You may use the optional Paint pointer parameter <paint_nexp> to specify a Paint object to modify.
Normally this parameter is omitted. See Gr.color, Advanced usage for more information.
Gr.set.stroke {{<nexp>}{,<paint_nexp>}}
Sets the line width of objects drawn after this command is issued. The <nexp> value must be >=0. Zero
produces the thinnest line and is the default stroke value.
The thinnest horizontal lines and vertical lines will be two pixels wide if AntiAlias is on. Turn AntiAlias off
to draw single-pixel-wide horizontal and vertical lines.