Pen.Pen

Overview | Methods | Fields | This Package | All Packages

Pen.Pen

Creates a Pen object.

Syntax

public Pen( Color color )

public Pen( Color color, int style )

public Pen( Color color, int style, int width )

public Pen( int handle )

Parameters

color

A Color object specifying the color of the pen.

style

The style of the pen to create. This value must be one of the enumeration constants defined in the PenStyle class.

width

The width of the pen in logical units. If this value is zero, the pen is one pixel wide, regardless of the current transformation.

handle

A Win32 pen handle (HPEN).

Exceptions

WFCInvalidArgumentException thrown if there is an illegal argument.

Remarks

If you create a Pen object specifying only a color, the style of the pen will be PenStyle.SOLID, and the pen will be one pixel wide.

If you create a Pen object based on a Win32 pen handle, the Pen object does not assume ownership of that pen. You are responsible for freeing the handle when you are finished using the object. For more information on handle destruction, see destroyHandle.