Condividi tramite


GDI Plus Pen Foundation Class

The gpPen class provides a pen object, which is used to draw lines and curves.

Category Reporting

Default Catalog

Visual FoxPro Catalog\Foundation Classes\Output\GDIplus

Class

gpPen

Base Class

Custom

Class Library

_GDIPLUS.vcx

Parent Class

gpObject (GDI Plus Object Foundation Class)

Remarks

The following table lists public properties and methods added by this class to its parent class, gpObject. This class also implements the Clone and Init methods.

Properties and methods Description

Alignment Property

Alignment of lines drawn with this pen on closed curves and polygons, according to the GP_PENALIGNMENT_* set of constants.

Clone Method

Clones a pen object.

Syntax: ? THIS.Clone(toGpPen)

Return Values: Logical, representing success or failure.

Parameters: 

toGpPen, required, the gpPen-based object to clone.

Create Method

Constructs a pen object of a specified color.

Syntax: THIS.Create(tvColor[, tnWidth[, tnUnit]])

Return Values: Logical, representing success or failure.

Parameters: 

tvColor, required, a gpColor object or numeric value representing a composite color value.

tnWidth, optional, pen width, defaults to 1.0.

tnUnit, optional, unit for tnWidth value, defaults to GDIPLUS_Unit_World.

CreateFromBrush Method

Creates a pen from an existing brush object.

Syntax: THIS.CreateFromBrush(toBrush[, tnWidth[, tnUnit]])

Return Values: Logical, representing success or failure.

Parameters: 

toBrush, required, a gpBrush-derived object.

tnWidth, optional, pen width, defaults to 1.0.

tnUnit, optional, unit for tnWidth value, defaults to GDIPLUS_Unit_World.

DashCap Property

Sets the cap style at the end of dashes, for dashed lines, as specified by GDIPLUS_DashCap_* defined constants.

Default:GDIPLUS_DashCap_Flat.

DashOffset Property

Sets the distances from the start of a line to the beginning of a dash pattern.

Default:0

DashStyle Property

Sets the style used for dashed lines, as specified by GDIPLUS_DashStyle_* defined constants.

Default:GDIPLUS_DashStyle_Solid.

EndCap Property

Sets the cap style at the end of lines drawn with this pen object, as specified by GDIPLUS_LineCap_* defined constants.

Default:GDIPLUS_LineCap_Flat.

Init Method

Constructs a pen object during initialization if passed appropriate arguments.

Syntax: CREATEOBJECT("gpPen" [,tvColor[, tnWidth[, tnUnit]]])

Return Values: Logical, representing success or failure. If the method fails, the object does not instantiate.

Parameters: 

tvColor, required if immediate creation of the object is requested, a gpColor object or numeric value representing a composite color value.

tnWidth, optional, pen width, defaults to 1.0.

tnUnit, optional, unit for tnWidth value, defaults to GDIPLUS_Unit_World.

LineJoin Property

Sets the join style for the ends of two consecutive lines drawn with this pen, as specified by GDIPLUS_LineJoin_* defined constants.

Default:GDIPLUS_LineJoin_Miter.

MiterLimit Property

The limit of the thickness of the join on a mitered corner (maximum allowed ratio of miter length to stroke width).

Default:10.0.

PenColor Property

Indicates the color of this pen object, using an integer to specify an ARGB value.

Default:0 (opaque black).

PenType Property

Sets the type of lines drawn with this pen object, as defined by GDIPLUS_PenType_* constants. Read-only.

Remarks: This property only applies to derivatives of gpPen, such as those created from brushes. Only solid pens (GDIPLUS_PenType_SolidColor) can be created with the stock gpPen Foundation class.

PenUnit Property

Indicates the unit for measuring width and other values, as specified by GDIPLUS_UNIT_* constants.

Default:GDIPLUS_Unit_World.

PenWidth Property

Sets the width of the pen object.

Default:1.0.

StartCap Property

Sets the cap style at the start of lines drawn with this pen object, as specified by GDIPLUS_LineCap_* defined constants.

Default:GDIPLUS_LineCap_Flat.

See Also

Reference

Visual FoxPro Foundation Classes A-Z
GDI Plus API Wrapper Foundation Classes

Concepts

Guidelines for Using Visual FoxPro Foundation Classes