Pen Class | |
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
Namespace:
VO
Assembly:
VOGUIClasses (in VOGUIClasses.dll) Version: 2.21
Syntax The Pen type exposes the following members.
Constructors
| Name | Description |
---|
| Pen |
Construct a pen.
|
TopMethods
| Name | Description |
---|
| Destroy |
Provide a method to de-instantiate a Pen object.
(Overrides Destroy.) |
| Handle |
Return the handle for a pen.
|
TopFields 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:
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