Table of Contents

Class GeoPen

Namespace
ThinkGeo.Core
Assembly
ThinkGeo.Core.dll

This class represents a GeoPen, which is used to draw lines on a GeoCanvas.

public class GeoPen
Inheritance
GeoPen
Inherited Members

Remarks

None

Constructors

GeoPen()

This constructor creates a GeoPen.

public GeoPen()

GeoPen(GeoBrush)

This constructor creates a GeoPen.

public GeoPen(GeoBrush brush)

Parameters

brush GeoBrush

This parameter represents the brush that will be used to draw the line.

Remarks

None

Exceptions

ArgumentNullException

If you pass a null value as the brush, we will throw an ArgumentNullException.

GeoPen(GeoBrush, float)

This constructor creates a GeoPen.

public GeoPen(GeoBrush brush, float width)

Parameters

brush GeoBrush

This parameter represents the brush that will be used to draw the line.

width float

This parameter represents the width of the line.

Remarks

None

Exceptions

ArgumentNullException

If you pass a null value as the brush, we will throw an ArgumentNullException.

ArgumentOutOfRangeException

If you pass in a width value that is not greater than zero, it will throw a ArgumentOutOfRangeException.

GeoPen(GeoColor)

This constructor creates a GeoPen.

public GeoPen(GeoColor color)

Parameters

color GeoColor

This parameter represents the color that will be used to draw the line.

Remarks

None

Exceptions

ArgumentNullException

If you pass a null value as the color, we will throw an ArgumentNullException.

GeoPen(GeoColor, float)

This constructor creates a GeoPen.

public GeoPen(GeoColor color, float width)

Parameters

color GeoColor

This parameter represents the color that will be used to draw the line.

width float

This parameter represents the width of the line.

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a width value that is not greater than zero, it will throw a ArgumentOutOfRangeException.

Properties

Brush

This property gets and sets the brush for this GeoPen.

public GeoBrush Brush { get; set; }

Property Value

GeoBrush

Remarks

None

Exceptions

ArgumentNullException

If you pass a null value as the brush, we will throw an ArgumentNullException.

Color

This property gets and sets the GeoColor for this GeoPen.

public GeoColor Color { get; set; }

Property Value

GeoColor

DashCap

This property gets and sets the dash cap for this GeoPen.

public GeoDashCap DashCap { get; set; }

Property Value

GeoDashCap

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a DashCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

DashPattern

This property gets the dash pattern for this GeoPen.

public Collection<float> DashPattern { get; }

Property Value

Collection<float>

Remarks

Assigning a value other than null (Nothing in Visual Basic) to this property will set the DashStyle property for this GeoPen to Custom. The elements in the dashArray array set the length of each dash and space in the dash pattern. The first element sets the length of a dash, the second element sets the length of a space, the third element sets the length of a dash, and so on. The length of each dash and space in the dash pattern is the product of the element value in the array and the width of the GeoPen.

Exceptions

ArgumentNullException

If you pass a null value as the DashPattern, we will throw an ArgumentNullException.

DashStyle

This property gets and sets the dash style for this GeoPen.

public LineDashStyle DashStyle { get; set; }

Property Value

LineDashStyle

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a DashStyle that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

EndCap

This property gets and sets the end cap for this GeoPen.

public DrawingLineCap EndCap { get; set; }

Property Value

DrawingLineCap

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a EndCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

Id

The id of the GeoBrush. This is always used as a key when in the cached brushes.

public long Id { get; }

Property Value

long

LineJoin

This property gets and sets the line join for this GeoPen.

public DrawingLineJoin LineJoin { get; set; }

Property Value

DrawingLineJoin

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a LineJoin that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

MiterLimit

This property gets and sets the miter limit for this GeoPen.

public float MiterLimit { get; set; }

Property Value

float

Remarks

None

StartCap

This property gets and sets the start cap for this GeoPen.

public DrawingLineCap StartCap { get; set; }

Property Value

DrawingLineCap

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a StartCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

Width

This property gets and sets the width for this GeoPen.

public float Width { get; set; }

Property Value

float

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a width value that is not greater than zero, it will throw a ArgumentOutOfRangeException.

Methods

CloneDeep()

Create a copy of GeoPen using the deep clone process.

public GeoPen CloneDeep()

Returns

GeoPen

A cloned GeoPen.

Remarks

The difference between deep clone and shallow clone is as follows: In shallow cloning, only the object is copied; the objects within it are not. By contrast, deep cloning copies the cloned object as well as all the objects within.

CloneDeepCore()

Create a copy of GeoPen using the deep clone process. The default implementation uses serialization.

protected virtual GeoPen CloneDeepCore()

Returns

GeoPen

A cloned GeoPen.

Remarks

The difference between deep clone and shallow clone is as follows: In shallow cloning, only the object is copied; the objects within it are not. By contrast, deep cloning copies the cloned object as well as all the objects within.

SetLineCap(DrawingLineCap, DrawingLineCap, GeoDashCap)

This method allows you to set the start, end and dash caps at one time.

public void SetLineCap(DrawingLineCap startCap, DrawingLineCap endCap, GeoDashCap dashCap)

Parameters

startCap DrawingLineCap

This parameter specifies the start cap to be used.

endCap DrawingLineCap

This parameter specifies the end cap to be used.

dashCap GeoDashCap

This parameter specifies the dash cap to be used.

Remarks

None

Exceptions

ArgumentOutOfRangeException

If you pass in a startCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

ArgumentOutOfRangeException

If you pass in a endCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.

ArgumentOutOfRangeException

If you pass in a dashCap that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.