class pen

superclass(es) object
subclass(es) -
description The pen class can be used for creating pens for drawing on a canvas.
see also canvas

tasks

The pen class has different methods for creating all kinds of pens, a special kind of pen is a null pen. A null pen is a pen that displays nothing and this kind of pen is useful when a method of the canvas class is called that uses a pen but the desired output must not include a pen. A null pen can be created by the method createNull/1.
A special pen, like a dash-dot-dot pen, can only be 1 pixel wide, solid and null pens can have any width.

methods

width(Output)

func The width of the pen in pixels is determined.
pre TRUE.
post The width of the pen was assigned to the variable Output.

isNull(Output)

func Determine if the pen is a NULL pen or not.
pre TRUE.
post If the pen is a NULL pen then Output was assigned true, else it was assigned false.

createNull(Width)

func Create a NULL pen of the specified width.
pre The Width variable must contain an integer value.
post A NULL pen of the specified width was created.

createSolid(Width, R, G, B)

func Create a solid pen of the specified width and color, the values of the variables R(ed), G(reen) and B(lue) determine the color of the pen.
pre The Width, R, G, and B variables must contain integers. The values of R, G, and B must be in the range [0, 255].
post A solid pen of the specified width and color was created.

createDash(R, G, B)

func Create a dash pen of the specified color, the values of the variables R(ed), G(reen) and B(lue) determine the color of the pen.
pre The R, G, and B variables must contain integers. The values of R, G, and B must be in the range [0, 255].
post A dash pen of the specified color was created.

createDot(R, G, B)

func Create a dotted pen of the specified color, the values of the variables R(ed), G(reen) and B(lue) determine the color of the pen.
pre The R, G, and B variables must contain integers. The values of R, G, and B must be in the range [0, 255].
post A dotted pen of the specified color was created.

createDashDot(R, G, B)

func Create a dash-dot pen of the specified color, the values of the variables R(ed), G(reen) and B(lue) determine the color of the pen.
pre The R, G, and B variables must contain integers. The values of R, G, and B must be in the range [0, 255].
post A dash-dot pen of the specified color was created.

createDashDotDot(R, G, B)

func Create a dash-dot-dot pen of the specified color, the values of the variables R(ed), G(reen) and B(lue) determine the color of the pen.
pre The R, G, and B variables must contain integers. The values of R, G, and B must be in the range [0, 255].
post A dash-dot-dot pen of the specified color was created.