Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

Give me hope to help me cope...

With this heavy load.

- George Harrison

 

aztec.ui.Pen

public class Pen from<Base>

Base

Pen

The Pen class represents a combination of color, line style (solid, dash, dot, etc.) and line width. It is used by the Aztec drawing methods when drawing lines and borders within the Canvas control.

 

Note that a Pen object uses UI system resources which are limited by the OS. It works most efficiently when allocated once and then used each time a window needs to be redrawn. Allocating a new Pen object every time a window has to be redrawn could eventually cause UI resources to run out.

 

The Pen object also registers a pen resource with the Display with which it will be used (which is passed into the constructor). If the Pen is used to write or draw on a Display other than the one for which it was created, a DisplayException will be fired.

Pen Methods

Pen() Constructor for the Pen class using Color, Style and Width
IsValid() Returns true if the Pen object is valid
Display() Reference to Display object where Pen was created

Pen Constants

Constant Data Item Data Type Value
Pen.Solid int 0
Pen.Dash int 1
Pen.Dot int 2
Pen.DashDot int 3

Derived Classes

See Also

 


Pen()

public method Pen(Color ColorRef, int LineStyle = Pen.Solid, int LineWidth = 1)

Parameters

Color

Color object to be used by the pen when drawing

LineStyle

Style for the line

LineWidth

Width of the line Blue component of the color (0-255)

Return Value

None

Description

Constructor for the Pen class. All line drawing using this pen will use the associated Color, line style and line width. The line style is one of the constants provided in this class (Solid, Dash, Dot or DashDot). The line width is specified in pixels. The Pen object is associated with the same Display that the Color object is associated with, and can only be used with that Display.

 

Pen Class


IsValid()

public method<bool> IsValid()

Parameters

None

Return Value

Returns true if the pen object is valid

Description

This method returns true if the pen is valid (based on the specified color, width, etc.).

 

Pen Class


Display()

public method<Display> Display()

Parameters

None

Return Value

Returns reference to Display object

Description

This method returns the reference to the Display object where the Pen was created (the Display that was passed into the constructor). If a null was passed into the constructor, the local display is used, and this method returns the reference to the local Display object.

 

A Pen resource is created within the context of a Display, and it can only be used with that Display. If a Pen is used with a Display where it was not created, a DisplayException will be fired.

 

Pen Class

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec