BeSly Software Solutions About yab Demos About us Admin


draw set -- set various drawing parameters

DRAW SET Color$, r,g,b, Target$
DRAW SET "Alpha", Alpha-Value
DRAW SET IsStroke, Pattern$
DRAW SET Font$, Target$ 

Draw set allows you to set various parameters for the other draw commands. 

Draw set with a Color$ allows you to set three different colors: the background color of Target$, the so-called lowcolor and the highcolor. At default, everything is drawn with the current highcolor, the lowcolor is useful for patterns which can have two colors. The background color can only be set for views, otherwise Target$ has to be either a valid view, bitmap or canvas.
If Color$ = "BGColor", the background color of the view Target$ is set, default is grey (216,216,216),
if Color$ = "LowColor", the lowcolor of Target$ is set, default is grey (216,216,216),
if Color$ = "HighColor", the highcolor of Target$ is set, default is black (0,0,0).

A short note about colors: On BeOS and ZETA, colors are notated with their three component colors red (r), green (g) and blue (b). These component colors are values between 0 (dark) and 255 (light) and mixed together (additive mixture) they represent a 32bit color space. Have a look at the colorcontrol widget to learn more about colors.

Draw set with "Alpha" as option sets the alpha channel value. At default it is set to 255 which is completly opaque. The smaller the alpha value gets, the more translucent following drawings will become. Note: This only affects the graphic primitives as dot, line, rect, text etc. but not draw image.
Note: When Alpha-Value is below 255, use only HighSolidFill to draw, patterns are ignored!
Note: Transparent drawing (that is Alpha-Value below 255) is not printed (see printer) correctly!

Draw set can also set the stroke or fill parameter and a pattern. If IsStroke is true, only the outline of circle, ellipse, rectangle and curve are drawn, otherwise they are filled up (which is the default setting). The Pattern$ specifies a pattern that is used for drawing and filling. The following patterns are predefined:
If Pattern$ = "HighSolidFill" solid fill is used with the current high color (default),
if Pattern$ = "LowSolidFill" solid fill is used with the current low color,
if Pattern$ = "CheckeredFill" checkered fill is used as a combination of low- and highcolor,
otherwise Pattern$ is a 8x8 1bit map where one line is one character which is written out as its ASCII code.
Use the pattern editor to draw and calculate patterns for your convenience.

DRAW SET Font$, View$
  Set the drawing font on View$.
  Font$ = FontFamily$ + "," + FontStyle$ + "," + Size + "," + FontOption$ + "," Rotation + "," + Shear
    where FontOption$ can contain the following options (only used when supported by the font):
    FontOption$ = "bold" or "italic" or "outlined" or "underscore" or "strikeout" or "regular" (regular is default)
    where Rotation is between 0.0 (default) and 360.0
    where Shear is between 45.0 (slanted to right) and 135.0 (slanted to left) with 90.0 default
  or Font$ = "system-plain" for the plain system font,
  or Font$ = "system-bold" for the bold system font,
  or Font$ = "system-fixed" for the fixed system font

	REM Define the Font Family, Style, Size and the FontOption, Rotation, Shear
	FontFamily$ = "Noto Sans Display" 
	FontStyle$ = "Regular" 
	Rotation$ = "90"
	Font$=FontFamily$ + "," + FontStyle$ + "," + Size$ + "," + FontOption$ + "," +Rotation$+ "," + Shear$
	DRAW SET  Font$ , View$ 
	DRAW TEXT 100,100 ,"This is the TEXT" ,View$
	This Example draws the text < "This is the TEXT" > on position 100,100 on the View View$. The text will be Rotated 90 degrees to the  	

Related: draw circle, draw curve, draw dot, draw ellipse, draw get, draw get$, draw line, draw rect, draw text, draw triangle, view