Class PointStyle
This class allows you to define how points are drawn on the view.
public class PointStyle : PointBaseStyle
- Inheritance
-
PointStyle
- Inherited Members
Remarks
This class allows you to define how points are drawn on the view. There are
three main drawing types: bitmap, character, and symbol. The bitmap allows you to
represent each point with a bitmap. The character allows you to choose a font and an
index in the font so you can use that character for the point. This is especially helpful
with fonts like Wingdings that have many feature-style graphics. The symbol type is a
collection of simple geometric symbols that we have assembled to represent abstract
items on the map.
When you select a PointType, you need to be sure to set the various properties
associated with that type. The property names are prefixed to help you. For example, all
of the character-related properties are prefixed with "Glyph" and the symbol properties
follow a similar pattern.
Constructors
PointStyle()
This is a constructor for the class.
public PointStyle()
Remarks
If you use this constructor, you should set the various properties manually. Specifically, you will want to set the PointType, which allows you to choose between bitmap, character and symbol as an option for displaying your points.
PointStyle(GeoFont, string, GeoBrush)
This is a constructor for the class.
public PointStyle(GeoFont glyphFont, string glyphContent, GeoBrush fillBrush)
Parameters
glyphFont
GeoFontThis parameter is the font from which the character will be selected.
glyphContent
stringThis parameter is the index of the character in the chosen font.
fillBrush
GeoBrushThis parameter is the SolidBrush used to draw the character.
Remarks
If you use this constructor, the PointStyle will be set to Glyph.
PointStyle(GeoFont, string, GeoBrush, GeoPen)
This is a constructor for the class.
public PointStyle(GeoFont glyphFont, string glyphContent, GeoBrush fillBrush, GeoPen outlinePen)
Parameters
glyphFont
GeoFontThis parameter is the font from which the character will be selected.
glyphContent
stringThis parameter is the index of the character in the chosen font.
fillBrush
GeoBrushThis parameter is the SolidBrush used to draw the character.
outlinePen
GeoPenThis parameter is the Pen used to draw the character.
PointStyle(GeoImage)
This is a constructor for the class.
public PointStyle(GeoImage image)
Parameters
image
GeoImageThis parameter is the NativeImage of the image you want to use to display the point.
Remarks
If you use this constructor, the PointStyle will be set to Image.
PointStyle(PointSymbolType, int, GeoBrush)
This is a constructor for the class.
public PointStyle(PointSymbolType symbolType, int symbolSize, GeoBrush fillBrush)
Parameters
symbolType
PointSymbolTypeThis parameter is the type of symbol you want to use, such as a square or a circle.
symbolSize
intThis parameter is the size you want the symbol to be.
fillBrush
GeoBrushThis parameter is the SolidBrush you want to use to fill the inside of the symbol.
Remarks
If you use this constructor, the PointStyle will be set to Symbol.
PointStyle(PointSymbolType, int, GeoBrush, GeoPen)
This is a constructor for the class.
public PointStyle(PointSymbolType symbolType, int symbolSize, GeoBrush fillBrush, GeoPen outlinePen)
Parameters
symbolType
PointSymbolTypeThis parameter is the type of symbol you want to use, such as a square or a circle.
symbolSize
intThis parameter is the size you want the symbol to be.
fillBrush
GeoBrushThis parameter is the SolidBrush you want to use to fill the inside of the symbol.
outlinePen
GeoPenThis parameter is the Pen used to draw the outline of the symbol.
Remarks
If you use this constructor, the PointStyle will be set to Symbol.
Properties
GlyphContent
This property gets and sets the content of the character you want to use from the font you selected in the CharacterFont property.
public string GlyphContent { get; set; }
Property Value
- string
This property gets the content of the character you want to use from the font you selected in the CharacterFont property.
Remarks
You need to specify the content of the character you want to use from the font you selected. For example, if you choose 1, then we will use the first character in the font you set in the CharacterFont property.
GlyphFont
This property gets and sets the font that is used for the character if the PointType is Glyph.
public GeoFont GlyphFont { get; set; }
Property Value
- GeoFont
This property gets the font that is used for the character if the PointType is Glyph.
Remarks
This property allows you to set the font from which to select a character index if you choose the Glyph PointType.
Image
This property gets and sets the image used if the PointType property is Image.
public GeoImage Image { get; set; }
Property Value
- GeoImage
This property gets the image used if the PointType property is Image.
Remarks
This property is where you can set the image for the points if the PointType is Image. It uses a NativeImage, so you can either reference a file or supply a stream.
ImageScale
This property gets and sets the scale of the image you want to draw.
public double ImageScale { get; set; }
Property Value
- double
This property gets the scale of the image you want to draw.
Remarks
This property allows you to scale the image up and down depending on how large or small you want it. It can be changed dynamically, so you could change it at every scale level to resize the bitmap based on the current scale. A scale of 1 would be the original size, while a scale of 2 would double the size. A scale of .5 would reduce the size of the image by half, and so on.
Mask
public AreaStyle Mask { get; set; }
Property Value
MaskMargin
public DrawingMargin MaskMargin { get; set; }
Property Value
MaskType
public MaskType MaskType { get; set; }
Property Value
PointType
This property gets and sets the type of point you want to draw.
public PointType PointType { get; set; }
Property Value
- PointType
This property gets the type of point you want to draw.
Remarks
When using the PointStyle you choose between a bitmap, a font or a predefined symbol to represent the point. Each of these options has corresponding properties on the point symbol. If you set the type to character, then you need to set the properties that start with "Glyph," such as "CharacterFont." The same is true for the symbol.
SymbolType
This property gets and sets the type of symbol you want to use if the PointType is Symbol.
public PointSymbolType SymbolType { get; set; }
Property Value
- PointSymbolType
This property gets the type of symbol you want to use if the PointType is Symbol.
Remarks
You can choose between a number of predefined symbols. The symbols are simple geometric objects that are typically used for abstract representations on a map. If there is a specific symbol you need that is not part of our symbol collection, you can submit it to us and we will consider adding it.
Methods
CreateCompoundCircleStyle(GeoColor, float, GeoColor, float, GeoColor, float)
Static API to create a compound circle point style.
public static PointStyle CreateCompoundCircleStyle(GeoColor fillColor1, float size1, GeoColor outlineColor1, float outlineWidth1, GeoColor fillColor2, float size2)
Parameters
fillColor1
GeoColorThis parameter determines the outer circle's PointStyle fill color.
size1
floatThis parameter determines the outer circle's PointStyle size.
outlineColor1
GeoColorThis parameter determines the outer circle's PointStyle outline color.
outlineWidth1
floatThis parameter determines the outer circle's PointStyle outline width.
fillColor2
GeoColorThis parameter determines the inner circle's PointStyle fill color.
size2
floatThis parameter determines the inner circle's PointStyle size.
Returns
- PointStyle
The created point style.
CreateCompoundCircleStyle(GeoColor, float, GeoColor, float, GeoColor, float, GeoColor, float)
Static API to create a compound circle point style.
public static PointStyle CreateCompoundCircleStyle(GeoColor fillColor1, float size1, GeoColor outlineColor1, float outlineWidth1, GeoColor fillColor2, float size2, GeoColor outlineColor2, float outlineWidth2)
Parameters
fillColor1
GeoColorThis parameter determines the outer circle's PointStyle fill color.
size1
floatThis parameter determines the outer circle's PointStyle size.
outlineColor1
GeoColorThis parameter determines the outer circle's PointStyle outline color.
outlineWidth1
floatThis parameter determines the outer circle's PointStyle outline width.
fillColor2
GeoColorThis parameter determines the inner circle's PointStyle fill color.
size2
floatThis parameter determines the inner circle's PointStyle size.
outlineColor2
GeoColorThis parameter determines the inner circle's PointStyle outline color.
outlineWidth2
floatThis parameter determines the inner circle's PointStyle outline width.
Returns
- PointStyle
The created point style.
CreateCompoundPointStyle(PointSymbolType, GeoColor, GeoColor, float, float, PointSymbolType, GeoColor, GeoColor, float, float)
Static API to create a compound circle point style.
public static PointStyle CreateCompoundPointStyle(PointSymbolType pointStyle1, GeoColor fillColor1, GeoColor outlineColor1, float outlineWidth1, float size1, PointSymbolType pointStyle2, GeoColor fillColor2, GeoColor outlineColor2, float outlineWidth2, float size2)
Parameters
pointStyle1
PointSymbolTypeThis parameter determines the outer circle's pointstyle symbol type.
fillColor1
GeoColorThis parameter determines the outer circle's PointStyle fill color.
outlineColor1
GeoColorThis parameter determines the outer circle's PointStyle outline color.
outlineWidth1
floatThis parameter determines the outer circle's PointStyle outline width.
size1
floatThis parameter determines the outer circle's PointStyle size.
pointStyle2
PointSymbolTypeThis parameter determines the inner circle's pointstyle symbol type.
fillColor2
GeoColorThis parameter determines the inner circle's PointStyle fill color.
outlineColor2
GeoColorThis parameter determines the inner circle's PointStyle outline color.
outlineWidth2
floatThis parameter determines the inner circle's PointStyle outline width.
size2
floatThis parameter determines the inner circle PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleCircleStyle(GeoColor, float)
Static API to create a circle point style.
public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleCircleStyle(GeoColor, float, GeoColor)
Static API to create a circle point style.
public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size, GeoColor outlineColor)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
Returns
- PointStyle
The created point style.
CreateSimpleCircleStyle(GeoColor, float, GeoColor, float)
Static API to create a circle point style.
public static PointStyle CreateSimpleCircleStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
outlineWidth
floatThis parameter determines the PointStyle outline width.
Returns
- PointStyle
The created point style.
CreateSimplePointStyle(PointSymbolType, GeoColor, float)
Static API to create a point style.
public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, float size)
Parameters
pointStyle
PointSymbolTypeThis parameter determines the PointStyle symbol type.
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimplePointStyle(PointSymbolType, GeoColor, GeoColor, float)
Static API to create a point style.
public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, GeoColor outlineColor, float size)
Parameters
pointStyle
PointSymbolTypeThis parameter determines the PointStyle symbol type.
fillColor
GeoColorThis parameter determines the PointStyle fill color.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimplePointStyle(PointSymbolType, GeoColor, GeoColor, float, float)
Static API to create a point style.
public static PointStyle CreateSimplePointStyle(PointSymbolType pointStyle, GeoColor fillColor, GeoColor outlineColor, float outlineWidth, float size)
Parameters
pointStyle
PointSymbolTypeThis parameter determines the PointStyle symbol type.
fillColor
GeoColorThis parameter determines the PointStyle fill color.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
outlineWidth
floatThis parameter determines the PointStyle outline width.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleSquareStyle(GeoColor, float)
Static API to create a square point style.
public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleSquareStyle(GeoColor, float, GeoColor)
Static API to create a square point style.
public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size, GeoColor outlineColor)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
Returns
- PointStyle
The created point style.
CreateSimpleSquareStyle(GeoColor, float, GeoColor, float)
Static API to create a square point style.
public static PointStyle CreateSimpleSquareStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
outlineWidth
floatThis parameter determines the PointStyle outline width.
Returns
- PointStyle
The created point style.
CreateSimpleStarStyle(GeoColor, float)
Static API to create a star point style.
public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleStarStyle(GeoColor, float, GeoColor)
Static API to create a star point style.
public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size, GeoColor outlineColor)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
Returns
- PointStyle
The created point style.
CreateSimpleStarStyle(GeoColor, float, GeoColor, float)
Static API to create a star point style.
public static PointStyle CreateSimpleStarStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
outlineWidth
floatThis parameter determines the PointStyle outline width.
Returns
- PointStyle
The created point style.
CreateSimpleTriangleStyle(GeoColor, float)
Static API to create a triangle point style.
public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
Returns
- PointStyle
The created point style.
CreateSimpleTriangleStyle(GeoColor, float, GeoColor)
Static API to create a triangle point style.
public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size, GeoColor outlineColor)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
Returns
- PointStyle
The created point style.
CreateSimpleTriangleStyle(GeoColor, float, GeoColor, float)
Static API to create a triangle point style.
public static PointStyle CreateSimpleTriangleStyle(GeoColor fillColor, float size, GeoColor outlineColor, float outlineWidth)
Parameters
fillColor
GeoColorThis parameter determines the PointStyle fill color.
size
floatThis parameter determines the PointStyle size.
outlineColor
GeoColorThis parameter determines the PointStyle outline color.
outlineWidth
floatThis parameter determines the PointStyle outline width.
Returns
- PointStyle
The created point style.
DrawCore(IEnumerable<Feature>, GeoCanvas, Collection<SimpleCandidate>, Collection<SimpleCandidate>)
This method draws the features on the view you provided.
protected override 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
GeoCanvasThis 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.
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.
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 symbolPen is null, we will throw an ArgumentNullException.
- ArgumentNullException
If symbolSolidBrush is null, we will throw an ArgumentNullException.
- ArgumentNullException
If characterSolidBrush is null, we will throw an ArgumentNullException.
- ArgumentNullException
If glyphFont is null, we will throw an ArgumentNullException.
- ArgumentOutOfRangeException
If you pass in a pointSymbolType that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
- ArgumentOutOfRangeException
If you pass in a pointType that is not defined in the enumeration, it will throw a ArgumentOutOfRangeException.
- ArgumentOutOfRangeException
If you pass in a imageScale that is less or equal to 0, it will throw an ArgumentOutOfRangeException.
DrawGlyph(GeoFont, string, Feature, GeoCanvas, GeoBrush, GeoPen, float, float)
protected void DrawGlyph(GeoFont glyphFont, string glyphConent, Feature pointFeature, GeoCanvas canvas, GeoBrush geoBrush, GeoPen geoPen, float symbolSize, float rotationAngle)
Parameters
glyphFont
GeoFontglyphConent
stringpointFeature
Featurecanvas
GeoCanvasgeoBrush
GeoBrushgeoPen
GeoPensymbolSize
floatrotationAngle
float
DrawImage(GeoImage, Feature, GeoCanvas, float, float)
protected void DrawImage(GeoImage geoImage, Feature feature, GeoCanvas canvas, float symbolSize, float rotationAngle)
Parameters
DrawSampleCore(GeoCanvas, DrawingRectangleF)
This method draws a sample feature on the view you provided.
protected override void DrawSampleCore(GeoCanvas canvas, DrawingRectangleF drawingExtent)
Parameters
canvas
GeoCanvasThis parameter represents the view you want to draw the features on.
drawingExtent
DrawingRectangleF
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.
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.
DrawSymbol(PointSymbolType, Feature, GeoCanvas, GeoBrush, GeoPen, float, float)
protected void DrawSymbol(PointSymbolType symbolType, Feature feature, GeoCanvas canvas, GeoBrush geoBrush, GeoPen geoPen, float symbolSize, float rotationAngle)
Parameters
symbolType
PointSymbolTypefeature
Featurecanvas
GeoCanvasgeoBrush
GeoBrushgeoPen
GeoPensymbolSize
floatrotationAngle
float
Parse(string)
public static PointStyle Parse(string styleJson)
Parameters
styleJson
string