|
Whitebeam Template Reference Documentation
|
GraphicImage Template
setPenThickness()
Set pen drawing thickness
Syntax
GraphicImage = rb.GraphicImage.setPenThickness(thickness)
Parameters
The 'setPenThickness' method takes 1 parameter:
Name | Type/Value | Range/Length | Description | thickness | number | | Optional, default = 1
The desired thickness (in pixels) of the pen to use
|
Results
The 'setPenThickness' method returns GraphicImage:
Type/Value | Range/Length | Description |
GraphicImage |
  |
Return a reference to the GraphicImage (to 'this')
|
Remarks By default drawing operations such as drawRectangle, use a pen thickness of 1 pixel. This
method allows the thickness to be adjusted. The thickness set only applies
to this image and remains the same until changed by a sebsequent call to this method.
Example
// Create an empty 100x100 pixel palette based image
var img = (new GraphicImage).create(100,100, false);
// Draw a red square 50x50 pixels with a border thickness of 3 pixels
var red = img.colourResolve(255, 0, 0);
img.setPenThickness(3);
img.drawRectangle({x:30,y:30},{x:80,y:80},red);
|
|
(loadtime : 29ms) |