[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'Graphics' (#lcl)

# TPen

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

The current Pen for drawing on the current Canvas

## Declaration

Source position: graphics.pp line 603

`type TPen = class(TFPCustomPen)`
`protected`
`procedure DoAllocateResources; override;` |  |
`procedure DoDeAllocateResources; override;` |  |
`procedure DoCopyProps(); override;` |  |
`procedure SetColor();` |  | SetColor - specifies Colour for the Pen
`procedure SetFPColor(); override;` |  |
`procedure SetEndCap();` |  | SetEndCap - specified the type of end cap to be used for the pen, if it is a geometric pen
`procedure SetJoinStyle();` |  | SetJoinStyle - specifies the style to be used by the geometric pen when lines join (at corners etc)
`procedure SetMode(); override;` |  |
`procedure SetStyle(); override;` |  |
`procedure SetWidth(); override;` |  |
`public`
`constructor Create; override;` |  | Create - constructor for TPen: performs inherited Create then sets some local defaults, style, mode, width and colour
`destructor Destroy; override;` |  | Destroy - destructor for TPen: frees reference then performs inherited Destroy
`procedure Assign(); override;` |  | Assign - copies settings from Source to itself (provided Source is another TPen), then performs inherited Assign
`property Handle: HPEN; [rw]` |  | The Operating System Handle for the current Pen
`property Reference: TWSPenReference; [r]` |  | A Reference made to this Pen
`function GetPattern;` |  | GetPattern - returns the pattern for the pen
`procedure SetPattern();` |  | SetPattern - specifies the pattern for the pen
`published`
`property Color: TColor; [rw]` |  | The Colour of the current Pen
`property Cosmetic: Boolean; [rw]` |  | Whether the Pen is Cosmetic, ie non-geometric
`property EndCap: TPenEndCap; [rw]` |  | The sort of EndCap used on the Pen
`property JoinStyle: TPenJoinStyle; [rw]` |  | JoinStyle - the style of joint where two lines meet or cross
`property Mode;`
`property Style;`
`property Width;`
`end;`

## Inheritance

`TPen` |  | The current Pen for drawing on the current Canvas
`TFPCustomPen`
?
`TObject`

The latest version of this document can be found at lazarus-ccr.sourceforge.net.