Pen Class (Typed) | |
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:
XSharp.VO.SDK
Assembly:
XSharp.VOGUIClasses (in XSharp.VOGUIClasses.dll) Version: 2.19
Syntax The Pen type exposes the following members.
Constructors
| Name | Description |
---|
| Pen |
Construct a pen.
|
TopFunctions
| Name | Description |
---|
| Destroy | Free memory resources allocated for a VObject object and its derived objects. (Overrides Destroy.) |
| Handle |
Return the handle for a pen.
|
TopGlobals and Defines 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