Skip to content

AreaStyle

Namespace: ThinkGeo.Core

This class is used to draw area features.

public class AreaStyle : Style

Inheritance Object → Style → AreaStyle

Remarks:

You should use this class to draw area features. You can specify a fill brush to draw the interior and an outline pen to draw the border. You can optionally choose to use only the outline pen or the fill brush, which enables you to generate different effects.

Properties

XOffsetInPixel

This property gets and sets the X pixel offset for drawing each feature.

public float XOffsetInPixel { get; set; }

Property Value

Single
This property gets the X pixel offset for drawing each feature.

Remarks:

This property allows you to specify an X offset. When combined with a Y offset, it enables you to achieve effects such as drop shadows, etc. There also may be times when you need to modify the location of feature data so as to align it with raster satellite data.

YOffsetInPixel

This property gets and sets the Y pixel offset for drawing each feature.

public float YOffsetInPixel { get; set; }

Property Value

Single
This property gets the Y pixel offset for drawing each feature.

Remarks:

This property allows you to specify a Y offset. When combined with an X offset, it enables you to achieve effects such as drop shadows, etc. There also may be times when you need to modify the location of feature data so as to align it with raster satellite data.

FillBrush

This property gets and sets the solid brush you want to use to fill in the area features.

public GeoBrush FillBrush { get; set; }

Property Value

GeoBrush

        This property represents the solid brush you want to use to fill in the area
        features.

Remarks:

This solid brush is used to fill in the area features that will draw. You can also optionally specify an outline pen to give the area an outline. The default solid brush has a fill color of transparent, which means it will not draw anything.

CustomAreaStyles

This property returns a collection of area styles, allowing you to stack multiple area styles on top of each other.

public Collection<AreaStyle> CustomAreaStyles { get; }

Property Value

Collection<AreaStyle>
This property returns a collection of area styles.

Remarks:

Using this collection, you can stack multiple area styles on top of each other. When we draw the features, we will draw them in order that they exist in the collection. You can use these stacks to create drop shadow effects, multiple colored outlines, etc.

OutlinePen

This property gets and sets the outline pen you want to use to outline the features.

public GeoPen OutlinePen { get; set; }

Property Value

GeoPen

        This property gets the outline pen you want to use to outline the
        features.

Remarks:

This outline pen is used to outline the features that will draw. You can also optionally specify a fill brush to give the area a solid fill. The default outline pen color is transparent, which means it will not draw anything.

PenBrushDrawingOrder

This property gets and sets the pen and brush drawing order.

public PenBrushDrawingOrder PenBrushDrawingOrder { get; set; }

Property Value

PenBrushDrawingOrder
This property gets the pen and brush drawing order.

Remarks:

This property controls whether the outline pen or the fill brush is drawn first. The default is for the fill brush to be drawn first. If you have the outline pen draw first then the thickness of the pen will be smaller, creating a subtle but noticeable effect.

DrawingLevel

public DrawingLevel DrawingLevel { get; set; }

Property Value

DrawingLevel

Name

This property gets and set the name of the style.

public string Name { get; set; }

Property Value

String
This property gets the name of the style.

Remarks:

This name is not used by the system; it is only for the developer. However, it can be used if you generate your own legend.

IsActive

This property gets and sets the active status of the style.

public bool IsActive { get; set; }

Property Value

Boolean
This property gets the active status of the style.

Remarks:

If the style is not active then it will not draw.

RequiredColumnNames

This property gets the collection of fields that are required for the style.

public Collection<string> RequiredColumnNames { get; }

Property Value

Collection<String>

        This property gets the collection of fields that are required for the
        style.

Remarks:

This property gets the collection of fields that are required for the style. These are in addition to any other columns you specify in styles that inherit from this one. For example, if you have use a ValueStyle and it requires a column name for the value comparison, then that column does not need to be in this collection. You only use the RequiredColumnNames for columns you need beyond those required by specific inherited styles.

Filters

public Collection<string> Filters { get; }

Property Value

Collection<String>

Constructors

AreaStyle()

This is the constructor for the class.

public AreaStyle()

Remarks:

If you use this constructor, you will need to set the properties of the fill brush and outline pen manually.

AreaStyle(GeoBrush)

This is the constructor for the class.

public AreaStyle(GeoBrush fillBrush)

Parameters

fillBrush GeoBrush
This parameter is the solid brush you want to fill the area with.

Remarks:

This constructor allows you to specify just a fill brush. In this way, the area you draw will not have an outline.

AreaStyle(GeoPen)

This is the constructor for the class.

public AreaStyle(GeoPen outlinePen)

Parameters

outlinePen GeoPen
This parameter is the outline pen you want to use to outline the area.

Remarks:

This constructor allows you to specify just an outline pen. In this way, the area you draw will have an outline, but a transparent interior (no fill).

AreaStyle(GeoPen, GeoBrush)

This is the constructor for the class.

public AreaStyle(GeoPen outlinePen, GeoBrush fillBrush)

Parameters

outlinePen GeoPen
This parameter is the outline pen you want to use to outline the area.

fillBrush GeoBrush
This parameter is the solid brush you wish to fill the area with.

Remarks:

This constructor allows you to specify a fill brush and an outline pen.

AreaStyle(GeoPen, GeoBrush, PenBrushDrawingOrder)

This is the constructor for the class.

public AreaStyle(GeoPen outlinePen, GeoBrush fillBrush, PenBrushDrawingOrder penBrushDrawingOrder)

Parameters

outlinePen GeoPen
This parameter is the outline pen you want to use to outline the area.

fillBrush GeoBrush
This parameter is the solid brush you wish to fill the area with.

penBrushDrawingOrder PenBrushDrawingOrder

        This parameter allows you to choose whether the outline pen or the fill brush is drawn
        first.

Remarks:

This constructor allows you to specify a fill brush and an outline pen. It also allows you to specify which is drawn first. If the pen is drawn first, the outline will be thinner than if the pen is drawn last. The effect is subtle but noticeable.

Methods

Parse(String)

public static AreaStyle Parse(string styleJson)

Parameters

styleJson String

Returns

AreaStyle

Parse(JObject)

internal static AreaStyle Parse(JObject jObject)

Parameters

jObject JObject

Returns

AreaStyle

CreateSimpleAreaStyle(GeoColor)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor)

Parameters

fillBrushColor GeoColor
This parameter is the fill color of the area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline pen color for the area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor, Int32)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, int outlinePenWidth)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline pen color for the area.

outlinePenWidth Int32
This parameter is the outline pen width for the area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor, Int32, LineDashStyle)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, int outlinePenWidth, LineDashStyle borderStyle)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline pen color for the area.

outlinePenWidth Int32
This parameter is the outline pen width for the area.

borderStyle LineDashStyle
This parameter is the BorderStyle for the area style.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, Single, Single)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, float xOffsetInPixel, float yOffsetInPixel)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

xOffsetInPixel Single
This parameter is the X pixels offset for this area.

yOffsetInPixel Single
This parameter is the Y pixels offset for this area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor, Single, Single)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, float xOffsetInPixel, float yOffsetInPixel)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline color for the area.

xOffsetInPixel Single
This parameter is the X pixels offset for this area.

yOffsetInPixel Single
This parameter is the Y pixels offset for this area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor, Int32, Single, Single)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, int outlinePenWidth, float xOffsetInPixel, float yOffsetInPixel)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline pen color for the area.

outlinePenWidth Int32
This parameter is the outline pen width for the area.

xOffsetInPixel Single
This parameter is the X pixels offset for this area.

yOffsetInPixel Single
This parameter is the Y pixels offset for this area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateSimpleAreaStyle(GeoColor, GeoColor, Int32, LineDashStyle, Single, Single)

This method builds a simple area style.

public static AreaStyle CreateSimpleAreaStyle(GeoColor fillBrushColor, GeoColor outlinePenColor, int outlinePenWidth, LineDashStyle borderStyle, float xOffsetInPixel, float yOffsetInPixel)

Parameters

fillBrushColor GeoColor
This parameter is the fill color for the area.

outlinePenColor GeoColor
This parameter is the outline pen color for the area.

outlinePenWidth Int32
This parameter is the outline pen width for the area.

borderStyle LineDashStyle
This parameter is the BorderStyle for the area.

xOffsetInPixel Single
This parameter is the X pixels offset for this area.

yOffsetInPixel Single
This parameter is the Y pixels offset for this area.

Returns

AreaStyle
This method builds a simple area style.

Remarks:

None

CreateHatchStyle(GeoHatchStyle, GeoColor, GeoColor)

This method returns an AreaStyle with a hatch pattern.

public static AreaStyle CreateHatchStyle(GeoHatchStyle hatchStyle, GeoColor foregroundBrushColor, GeoColor backgroundBrushColor)

Parameters

hatchStyle GeoHatchStyle
This parameter is the hatch pattern to be used.

foregroundBrushColor GeoColor
This property is the color of the foreground of the hatch pattern.

backgroundBrushColor GeoColor
This property is the color of the background of the hatch pattern.

Returns

AreaStyle
This property is the color of the foreground of the hatch pattern.

Remarks:

None

CreateHatchStyle(GeoHatchStyle, GeoColor, GeoColor, GeoColor)

This method returns an AreaStyle with a hatch pattern.

public static AreaStyle CreateHatchStyle(GeoHatchStyle hatchStyle, GeoColor foregroundBrushColor, GeoColor backgroundBrushColor, GeoColor outlinePenColor)

Parameters

hatchStyle GeoHatchStyle
This parameter is the hatch pattern to be used.

foregroundBrushColor GeoColor
This property is the color of the foreground of the hatch pattern.

backgroundBrushColor GeoColor
This property is the color of the background of the hatch pattern.

outlinePenColor GeoColor
This parameter is the border color for the area.

Returns

AreaStyle
This method returns an AreaStyle with a hatch pattern.

Remarks:

None

CreateHatchStyle(GeoHatchStyle, GeoColor, GeoColor, GeoColor, Int32, LineDashStyle, Single, Single)

This method returns a GeoHatchStyle.

public static AreaStyle CreateHatchStyle(GeoHatchStyle hatchStyle, GeoColor foregroundBrushColor, GeoColor backgroundColor, GeoColor outlinePenColor, int outlinePenWidth, LineDashStyle outlineDashStyle, float xOffsetInPixel, float yOffsetInPixel)

Parameters

hatchStyle GeoHatchStyle
This parameter is the hatch pattern to be used.

foregroundBrushColor GeoColor
This property is the color of the foreground of the hatch pattern.

backgroundColor GeoColor
This property is the color of the background of the hatch pattern.

outlinePenColor GeoColor
This parameter is the border color for the area.

outlinePenWidth Int32
This parameter is the border width for the area.

outlineDashStyle LineDashStyle
This parameter is the dahs style to be used for the border.

xOffsetInPixel Single
This parameter is the pixel offset for X.

yOffsetInPixel Single
This parameter is the pixel offset for Y.

Returns

AreaStyle
This method returns an AreaStyle with a hatch pattern.

CreateLinearGradientStyle(GeoColor, GeoColor, Single)

This method returns a linear gradient style.

public static AreaStyle CreateLinearGradientStyle(GeoColor fromColor, GeoColor toColor, float angle)

Parameters

fromColor GeoColor

        This parameter represents the starting GeoColor for the
        gradient.

toColor GeoColor

        This parameter represents the ending GeoColor for the
        gradient.

angle Single

        This parameter represents the angle of the color changing from start to
        end.

Returns

AreaStyle
This method returns an AreaStyle.

Remarks:

None

CreateLinearGradientStyle(GeoColor, GeoColor, Single, GeoColor)

This method returns a linear gradient style.

public static AreaStyle CreateLinearGradientStyle(GeoColor fromColor, GeoColor toColor, float angle, GeoColor outlinePenColor)

Parameters

fromColor GeoColor

        This parameter represents the starting GeoColor for the
        gradient.

toColor GeoColor

        This parameter represents the ending GeoColor for the
        gradient.

angle Single

        This parameter represents the angle of the color changing from start to
        end.

outlinePenColor GeoColor
This parameter represents the outline pen color of the area style.

Returns

AreaStyle
This method returns an AreaStyle.

Remarks:

None

CreateHueFamilyAreaStyle(GeoColor, GeoColor, Int32)

This method returns an AreaStyle.

public static AreaStyle CreateHueFamilyAreaStyle(GeoColor outlinePenColor, GeoColor baseColor, int numberOfColors)

Parameters

outlinePenColor GeoColor

        This parameter specifies the GeoPen you want to use on the outline of the area
        style.

baseColor GeoColor
The base GeoColor of the hue family colors.

numberOfColors Int32
The number of GeoColors in hue family to construct the areastyle.

Returns

AreaStyle
This method returns an AreaStyle.

Remarks:

None.

CreateHueFamilyLinearGradientAreaStyle(GeoColor, GeoColor, Int32, GeoColor, GeoColor, Single)

This method returns an AreaStyle in a family of hue-related colors drawn with a linear gradient.

public static AreaStyle CreateHueFamilyLinearGradientAreaStyle(GeoColor outlinePenColor, GeoColor baseColor, int numberOfColors, GeoColor fromColor, GeoColor toColor, float angle)

Parameters

outlinePenColor GeoColor

        This parameter specifies the GeoPen you want to use on the outline of the AreaStyle.

baseColor GeoColor
The base GeoColor for the hue family of colors.

numberOfColors Int32
The number of GeoColors in the hue family to construct the AreaStyle.

fromColor GeoColor

        This parameter represents the starting GeoColor for the
        gradient.

toColor GeoColor

        This parameter represents the ending GeoColor for the
        gradient.

angle Single
This parameter represents the angle for the gradient.

Returns

AreaStyle
This method returns an AreaStyle in a family of hue-related colors drawn with a linear gradient.

Remarks:

None.

CreateQualityFamilyAreaStyle(GeoColor, GeoColor, Int32)

This method returns an AreaStyle in a family of quality-realted colors.

public static AreaStyle CreateQualityFamilyAreaStyle(GeoColor outlinePenColor, GeoColor baseColor, int numberOfColors)

Parameters

outlinePenColor GeoColor

        This parameter specifies the GeoPen you want to use on the outline of the
        AreaStyle.

baseColor GeoColor
The base GeoColor for the quality family of colors.

numberOfColors Int32
The number of GeoColors in the quality-based family to construct the AreaStyle.

Returns

AreaStyle
This method returns an AreaStyle in a family of quality-realted colors.

CreateQualityFamilyLinearGradientAreaStyle(GeoColor, GeoColor, Int32, GeoColor, GeoColor, Single)

This method returns an AreaStyle in a family of quality-related colors drawn with a linear gradient.

public static AreaStyle CreateQualityFamilyLinearGradientAreaStyle(GeoColor outlinePenColor, GeoColor baseColor, int numberOfColors, GeoColor fromColor, GeoColor toColor, float angle)

Parameters

outlinePenColor GeoColor

        This parameter specifies the GeoPen you want to use on the outline of the
        AreaStyle.

baseColor GeoColor
The base GeoColor for the quality family of colors.

numberOfColors Int32
The number of GeoColors in quality-based family to construct the AreaStyle.

fromColor GeoColor

        This parameter represents the starting GeoColor for the
        gradient.

toColor GeoColor

        This parameter represents the ending GeoColor for the
        gradient.

angle Single
This parameter represents the angle for the gradient.

Returns

AreaStyle
This method returns an AreaStyle in a family of quality-related colors drawn with a linear gradient.

Remarks:

None.

DrawCore(IEnumerable<Feature>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate>)

This method draws the features on the view you provided.

protected void DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, Collection<SimpleCandidate> labelsInThisLayer, Collection<SimpleCandidate> labelsInAllLayers)

Parameters

features IEnumerable<Feature>
This parameter represents the features you want to draw on the view.

canvas GeoCanvas
This parameter represents the view you want to draw the features on.

labelsInThisLayer Collection<SimpleCandidate>
The labels will be drawn in the current layer only.

labelsInAllLayers Collection<SimpleCandidate>
The labels will be drawn in all layers.

Exceptions

InvalidOperationException
In the event you attempt to call this method when the GeoCanvas's IsDrawing mode is false, it will throw an InvalidOperationException.

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

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

ArgumentNullException
If OutlinePen is null, we will throw an ArgumentNullException.

ArgumentNullException
If FillSolidBrush is null, we will throw an ArgumentNullException.

Remarks:

This overridden method is called from the concrete public method Draw. In this method, we take the features you passed in and draw them on the view you provided. Each style (based on its properties) may draw each feature differently.


When overriding this method, consider each feature and its column data values. You can use the full power of the GeoCanvas to do the drawing. If you need column data for a feature, be sure to override the GetRequiredColumnNamesCore and add the columns you need to the collection. In many of the styles, we add properties to allow the user to specify which field they need; then, in the GetRequiredColumnNamesCore, we read that property and add it to the collection.

DrawSampleCore(GeoCanvas, DrawingRectangleF)

This method draws a sample feature on the view you provided.

protected void DrawSampleCore(GeoCanvas canvas, DrawingRectangleF drawingExtent)

Parameters

canvas GeoCanvas
This parameter represents the view you want to draw the features on.

drawingExtent DrawingRectangleF

Exceptions

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

InvalidOperationException
In the event you attempt to call this method when the GeoCanvas's IsDrawing mode is false, it will throw an InvalidOperationException.

Remarks:

This virtual method is called from the concrete public method Draw. In this method, we draw a sample style on the view you provided. This is typically used to display a legend or other sample area.

When implementing this virtual method, consider the view size and draw the sample image appropriately. You should keep in mind that the sample typically shows up on a legend.