7.5

Table Of Contents
SetLineWidth (procedure)
Sets the width of the pen used for drawing lines, boxes and other objects. When setting the line width, remember that the
exact location of the pen is on the middle of the line, with the stroke spilling over equally on both sides.
Syntax
setlinewidth( width )
Argument
widthSetLineWidth (procedure)
Measure value setting the width, in inches, of the drawing pen.
Code Sample Examples
Example 1
This example sets the pen width to 1/4 inch then draws a 2"x2" rectangle using that pen.
setlinewidth(0.25)
rectstroke(0,0,2,2)
SetStrokeColor (procedure)
Sets the colour of the pen used for drawing lines, boxes and other objects.
Syntax
setstrokecolor( colour )
Argument
colour
Colour array that can be expressed expressed using one, three or four values ranging from 0 to 255. For Grayscale, a single
value is used in the form [K]. For the RGB model, three values are used in the form [R, G, B]. For the CMYK model, four values
are used in the form [C, M, Y, K].
Code Sample Example
This example draws two empty rectangles of different colors.
Example
setstrokecolor([0,0,100]) %Sets stroke color to medium blue using the RGB model
rectstroke(0,0,1,1) %Draws a medium blue rectangle
setstrokecolor([0,0,255,0]) %Sets stroke color to bright yellow using the CMYK model
rectstroke(1,1,1,1) %Draws a bright yellow rectangle
Translate (procedure)
Offsets an object's position from its original spot on the page. The point of origin of any object is (0,0) by default. All com-
mands within an object are relative to that point of origin. Moving, or translating the point of origin allows you to reset the point
©2010 Objectif Lune Inc - 571 -