Click or drag to resize

Pen Class

X#
Create a pen, which can be used to draw lines in a particular color, style, and width. Pens are used by the Window:LineTo() method and the DrawObject hierarchy.
Inheritance Hierarchy
Object
  VObject
    Pen

Namespace:  VO
Assembly:  VOGUIClasses (in VOGUIClasses.dll) Version: 2.19
Syntax
 CLASS Pen INHERIT VObject
Request Example View Source

The Pen type exposes the following members.

Constructors
  NameDescription
Public methodPen
Construct a pen.
Top
Methods
  NameDescription
Public methodDestroy
Provide a method to de-instantiate a Pen object.
(Overrides Destroy.)
Public methodHandle
Return the handle for a pen.
Top
Fields
  NameDescription
Public fieldoCargo
Cargo slot.
(Inherited from VObject.)
Top
Remarks
X# provides a set of predefined pens, which are specified in the Pen:Init() method (the default color and width is used). In addition, if desired, you can also create a brush by specifying a color, line style, and width. Each window has a current pen, which can be set or changed using the Window:Pen property. A window's pen is used in subsequent line and rectangle drawing operations, and should not be deleted while it is the current selection.
Examples
The following example creates a pen and draws a line:
X#
1oMyPen := Pen{Color{COLORRED}, LINESOLID, 1}
2oOldPen := oMyWin:Pen
3oMyWin:Pen := oMyPen
4oMyWin:MoveTo(Point{100,100})
5oMyWin:LineTo(Point{200,100})
6oMyWin:Pen := oOldPen
See Also

Reference