Method: arc
Adds an arc to a picture
void arc(left, top, right, bottom, start, extent);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
bottom | int | The bottom of the defining box, in 1/1000" |
left | int | The left side of the defining box, in 1/1000" |
start | int | The start angle of the arc, measured clockwise in degrees from the start angle of 12 o'clock |
right | int | The right side of the defining box, in 1/1000" |
top | int | The top of the defining box, in 1/1000" |
extent | int | The number of degrees spanned by the arc, clockwise from the starting angle. Must a an integer 0 < extent < 360 |
If the defining rectangle is square, then the arc will be a segment of a circle with the specified start and extent angles. If the defining rectangle is non-square, the start and extent angles define points as if the box was square, then scaling is applied to produce an arc of the given shape.
Method: backColor
Sets the background (fill) color for subsequent drawing commands
void backColor(c);
void backColor(r, g, b);
backColor = c
Parameters | ||
---|---|---|
Name | Expected Type | Description |
g | int | The green component of the desired colour, in the range 0 - 255 |
c | int | The desired color specified as a hex value 0x00bbggrr or R + G*256 + B*65536 where R, G, and B are colour values from 0 (black) to 255 (maximum). 0 represents black and 0xffffff represents white. Specifying -1 means no drawing is done. |
b | int | The blue component of the desired colour, in the range 0 - 255 |
r | int | The red component of the desired colour, in the range 0 - 255 |
For language purists outside the U.S., this can also be specified as backColour
Method: convertPctToPoint
Method: dot
Draws a dot (filled circle) in the window
void dot(x, y, radius);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
radius | int | The radius of the dot, in pixels, defaults to 2 |
y | real | The y coordinate of the center of the dot, expressed as a percentage of the distance from top to bottom in the window |
x | real | The x coordinate of the center of the dot, expressed as a percentage of the distance from left to right in the window |
Method: ellipse
Adds an ellipse to a picture
void ellipse(left, top, right, bottom);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
bottom | int | The bottom of the bounding box, in 1/1000" |
left | int | The left side of the bounding box, in 1/1000" |
right | int | The right side of the bounding box, in 1/1000" |
top | int | The top of the bounding box, in 1/1000" |
Method: foreColor
Sets the foreground (line) color for subsequent drawing commands
void foreColor(c);
void foreColor(r, g, b);
foreColor = c
Parameters | ||
---|---|---|
Name | Expected Type | Description |
g | int | The green component of the desired colour, in the range 0 - 255 |
c | int | The desired color specified as a hex value 0x00bbggrr or R + G*256 + B*65536 where R, G, and B are colour values from 0 (black) to 255 (maximum). 0 represents black and 0xffffff represents white. Specifying -1 means no drawing is done. |
b | int | The blue component of the desired colour, in the range 0 - 255 |
r | int | The red component of the desired colour, in the range 0 - 255 |
For language purists outside the U.S., this can also be specified as foreColour
Method: getLineHitPos
Method: line
Draw a line in the window
void line(x1, y1, x2, y2);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
y2 | real | The y position of the ending point, expressed as a percentage of the distance from top to bottom in the window |
x2 | real | The x position of the ending point, expressed as a percentage of the distance from left to right in the window |
y1 | real | The y position of the starting point, expressed as a percentage of the distance from top to bottom in the window |
x1 | real | The x position of the starting point, expressed as a percentage of the distance from left to right in the window |
Method: lineWidth
Sets the line width for subsequent line drawing commands
void lineWidth(w);
lineWidth = w
Parameters | ||
---|---|---|
Name | Expected Type | Description |
w | int | The desired line width in pixels at normal zoom |
Property: objType
Returns a string with the name of this object class "DWWindow".
String = objType
Method: polygon
Adds a polygon to a picture
void polygon(x1, y1, x2, y2, ...);
void polygon(x1, y1);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
y2 | int | The y position of the next line end point, in 1/1000" |
x2 | int | The x position of the next line end point, in 1/1000" |
y1 | int | The y position of the starting point, in 1/1000" |
x1 | int | The x position of the starting point, in 1/1000" |
This can be called in either of two ways.
The first method allows you to completely specify the polygon with a single call by providing two or more x/y pairs as arguments. The first x/y pair given is the starting point and subsequent pairs represent the polygon points.
The second method allows you to specify the polygon one point at a time. This method is more useful if the points are being generated by a loop under program control. The first time this method is called, the x/y pair given is considered to be the starting point. Subsequent calls provide additional points. Points continue to be accumulated into the same polygon until either polygonClose is called, any non-polygon drawing method is called or the picture is closed.
NOTE: Polygons are always closed. If the last point specified is not the same as the first, an additional line is added to close it. The line width, line color and fill color are set by the lineWidth, fgColour and backColor methods, respectively.
Method: polygonClose
Closes the current polygon, i.e. draws any points accumulate using method "polygon" as a closed polygon figure.
void polygonClose();
Property: readOnly
Returns true if the library file is marked "read only" by the file system.
bool = readOnly
Method: rect
Adds a rectangle to a picture
void rect(left, top, right, bottom);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
bottom | int | The bottom of the rectangle, in 1/1000" |
left | int | The left side of the rectangle, in 1/1000" |
right | int | The right side of the rectangle, in 1/1000" |
top | int | The top of the rectangle, in 1/1000" |
Method: setCoordSystem
Sets the coordinate scale factor and origin
void setCoordSystem(scaleType, originType);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
scaleType | String | Can be one of "pc" (percentage of width or height of window), "cm" (centimetres), or "in" (inches) |
originType | String | Can be one of "tl" (top-left), "tr" (top-right), "br" (bottom-right), or "bl" (bottom-left) |
All measurements are positive values from the origin into the symbol. If either parameter is omitted or not recognized, then the associated value is not changed
Method: text
Draws text to a window
void text(str, x, y);
void text(str, x, y, just);
Parameters | ||
---|---|---|
Name | Expected Type | Description |
y | int | The y position of the anchor point, in 1/1000" |
x | int | The x position of the anchor point, in 1/1000" |
str | String | The text string to place |
just | String | Optional, specifies the text justification, i.e. the position of the anchor point relative to the text. This consists of 1 character specifying the horizontal justification and one for the vertical. If the character "L" or "R" appears, the XY position specifies the left hand side or right hand side of the text, respectively. If neither appears, middle is assumed. If the character "T" or "B" appears, the XY position specifies the top or bottom of the text, respectively. If neither appears, middle is assumed. The order of the characters is not important and all unknown characters are ignored. If this is not specified, the text will be centered around the given point. |
Method: textBold
Sets the text bold setting for subsequent text drawing commands
void textBold(b);
textBold = b
Parameters | ||
---|---|---|
Name | Expected Type | Description |
b | bool | TRUE for bold text, FALSE for normal |
Method: textFont
Sets the text font name for subsequent text drawing commands
void textFont(name);
textFont = name
Parameters | ||
---|---|---|
Name | Expected Type | Description |
name | String | The desired font name |
Method: textItalic
Sets the text italic setting for subsequent text drawing commands
void textItalic(b);
textItalic = b
Parameters | ||
---|---|---|
Name | Expected Type | Description |
b | bool | TRUE for italic text, FALSE for normal |
Method: textRotation
Sets the text rotation for subsequent text drawing commands
void textRotation(r);
textRotation = p
Parameters | ||
---|---|---|
Name | Expected Type | Description |
r | int | The desired rotation, in degrees counterclockwise from the normal position |
Method: textSize
Sets the text size for subsequent text drawing commands
void textSize(p);
textSize = p
Parameters | ||
---|---|---|
Name | Expected Type | Description |
p | int | The desired point size (approx. 1/72") |