Skip to content

GeoPen

Namespace: ThinkGeo.Core

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

public class GeoPen

Inheritance ObjectGeoPen

Remarks:

None

Properties

Brush

This property gets and sets the brush for this GeoPen.

public GeoBrush Brush { get; set; }

Property Value

GeoBrush

Exceptions

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

Remarks:

None

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

Exceptions

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

Remarks:

None

DashPattern

This property gets the dash pattern for this GeoPen.

public Collection<float> DashPattern { get; }

Property Value

Collection<Single>

Exceptions

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

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.

DashStyle

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

public LineDashStyle DashStyle { get; set; }

Property Value

LineDashStyle

Exceptions

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

Remarks:

None

EndCap

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

public DrawingLineCap EndCap { get; set; }

Property Value

DrawingLineCap

Exceptions

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

Remarks:

None

LineJoin

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

public DrawingLineJoin LineJoin { get; set; }

Property Value

DrawingLineJoin

Exceptions

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

Remarks:

None

MiterLimit

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

public float MiterLimit { get; set; }

Property Value

Single

Remarks:

None

StartCap

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

public DrawingLineCap StartCap { get; set; }

Property Value

DrawingLineCap

Exceptions

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

Remarks:

None

Width

This property gets and sets the width for this GeoPen.

public float Width { get; set; }

Property Value

Single

Exceptions

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

Remarks:

None

Id

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

public long Id { get; }

Property Value

Int64

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.

Exceptions

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

Remarks:

None

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.

Exceptions

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

Remarks:

None

GeoPen(GeoColor, Single)

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 Single
This parameter represents the width of the line.

Exceptions

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

Remarks:

None

GeoPen(GeoBrush, Single)

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 Single
This parameter represents the width of the line.

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.

Remarks:

None

Methods

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.

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.

Remarks:

None

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 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.