Next: , Previous: , Up: Classes   [Index]


Pen

Pen Class

Pen class objects define drawing parameters for graphics primitives when drawing points or lines. Currently the only parameter that Pen implements with the width instance variable, which controls the width of graphics shapes like points and lines.

The Point class section contains an example of how to use Pen objects when drawing graphics. See Point.

Instance Variables

alpha

Defines an object’s opacity when using drawing libraries that support alpha channel blending (presently that is only the Line class drawing library, which uses the X Render extension). The value is an Integer in the range, 0..65535 (0..0xffff hexadecimal). For graphics library functions that do not support alpha blending, this value is not used.

colorName

A String containing the name of the Pen object’s color. The X Window System’s libraries use color names defined in the server’s rgb.txt file, which is normally located a directory that contains the server’s configuration files (e.g., <prefix>/etc/X11 or similar).

width

The width in pixels of a line when drawing non-filled shapes. The default is 1.