ThinkGeo.MapSuite.Core.GdiPlusGeoCanvas
Note: The page was created before Map Suite 10. Map Suite 10.0 organized many classes into new namespaces and assemblies as well as had a few minor breaks in compatibility. The majority of previously built code should work without modification assuming the new namespaces are added. For guidance on upgrading your existing code, please check out MapSuite 10 Upgrade Guide.
This class represents a canvas that is used to draw geographic shapes with GDI+.
Inheritance Hierarchy
Members Summary
Public Constructors
GdiPlusGeoCanvas()
Parameters
Protected Constructors
Public Methods
GetStreamFromGeoImage(GeoImage)
Return Value
Parameters
DrawWorldImageWithoutScaling(Bitmap,Double,Double,DrawingLevel)
Drawing an image unscaled is faster than using the API that scales it.
Return Value
Type:Void
Description:N/A
Parameters
DrawWorldImageWithoutScaling(Bitmap,Double,Double,DrawingLevel,Single,Single,Single)
Drawing an image unscaled is faster than using the API that scales it.
Return Value
Type:Void
Description:N/A
Parameters
DrawScreenImageWithoutScaling(Bitmap,Single,Single,DrawingLevel,Single,Single,Single)
Drawing an image unscaled is faster than using the API that scales it.
Return Value
Type:Void
Description:N/A
Parameters
CloneDeep()
Return Value
Parameters
Clear(GeoBrush)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(Feature,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(AreaBaseShape,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(Feature,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(AreaBaseShape,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(Feature,GeoPen,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(AreaBaseShape,GeoPen,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawArea(Feature,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawArea(AreaBaseShape,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawArea(IEnumerable<ScreenPointF[]>,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawLine(Feature,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawLine(LineBaseShape,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
DrawLine(Feature,GeoPen,DrawingLevel,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawLine(LineBaseShape,GeoPen,DrawingLevel,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawLine(IEnumerable<ScreenPointF>,GeoPen,DrawingLevel,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawEllipse(Feature,Single,Single,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(PointBaseShape,Single,Single,GeoPen,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(Feature,Single,Single,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(PointBaseShape,Single,Single,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(Feature,Single,Single,GeoPen,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(PointBaseShape,Single,Single,GeoPen,GeoBrush,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
DrawEllipse(Feature,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawEllipse(PointBaseShape,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawEllipse(ScreenPointF,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
width
Type:Single
Description:N/A
height
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
DrawWorldImageWithoutScaling(GeoImage,Double,Double,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
centerXInWorld
Type:Double
Description:N/A
centerYInWorld
Type:Double
Description:N/A
DrawWorldImageWithoutScaling(GeoImage,Double,Double,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
centerXInWorld
Type:Double
Description:N/A
centerYInWorld
Type:Double
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
DrawScreenImageWithoutScaling(GeoImage,Single,Single,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
centerXInScreen
Type:Single
Description:N/A
centerYInScreen
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
DrawWorldImage(GeoImage,Double,Double,Single,Single,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
centerXInWorld
Type:Double
Description:N/A
centerYInWorld
Type:Double
Description:N/A
widthInScreen
Type:Single
Description:N/A
heightInScreen
Type:Single
Description:N/A
DrawWorldImage(GeoImage,Double,Double,Double,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
centerXInWorld
Type:Double
Description:N/A
centerYInWorld
Type:Double
Description:N/A
imageScale
Type:Double
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
DrawWorldImage(GeoImage,Double,Double,Single,Single,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
centerXInWorld
Type:Double
Description:N/A
centerYInWorld
Type:Double
Description:N/A
widthInScreen
Type:Single
Description:N/A
heightInScreen
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
DrawScreenImage(GeoImage,Single,Single,Single,Single,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
centerXInScreen
Type:Single
Description:N/A
centerYInScreen
Type:Single
Description:N/A
widthInScreen
Type:Single
Description:N/A
heightInScreen
Type:Single
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
DrawTextWithScreenCoordinate(String,GeoFont,GeoBrush,Single,Single,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
upperLeftXInScreen
Type:Single
Description:N/A
upperLeftYInScreen
Type:Single
Description:N/A
DrawTextWithScreenCoordinate(String,GeoFont,GeoBrush,GeoPen,Single,Single,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
upperLeftXInScreen
Type:Single
Description:N/A
upperLeftYInScreen
Type:Single
Description:N/A
DrawTextWithWorldCoordinate(String,GeoFont,GeoBrush,Double,Double,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
upperLeftXInWorld
Type:Double
Description:N/A
upperLeftYInWorld
Type:Double
Description:N/A
DrawTextWithWorldCoordinate(String,GeoFont,GeoBrush,GeoPen,Double,Double,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
upperLeftXInWorld
Type:Double
Description:N/A
upperLeftYInWorld
Type:Double
Description:N/A
DrawText(String,GeoFont,GeoBrush,IEnumerable<ScreenPointF>,DrawingLevel)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
DrawText(String,GeoFont,GeoBrush,GeoPen,IEnumerable<ScreenPointF>,DrawingLevel,Single,Single,Single)
Return Value
Type:Void
Description:N/A
Parameters
text
Type:String
Description:N/A
xOffset
Type:Single
Description:N/A
yOffset
Type:Single
Description:N/A
rotateAngle
Type:Single
Description:N/A
MeasureText(String,GeoFont)
Return Value
Parameters
text
Type:String
Description:N/A
BeginDrawing(Object,RectangleShape,GeographyUnit)
Return Value
Type:Void
Description:N/A
Parameters
nativeImage
Type:Object
Description:N/A
ToNativeImage(GeoImage)
Return Value
Type:Object
Description:N/A
Parameters
ToGeoImage(Object)
Return Value
Parameters
nativeImage
Type:Object
Description:N/A
EndDrawing()
Return Value
Type:Void
Description:N/A
Parameters
Flush()
Return Value
Type:Void
Description:N/A
Parameters
ToString()
Return Value
Type:String
Description:N/A
Parameters
Equals(Object)
Return Value
Type:Boolean
Description:N/A
Parameters
obj
Type:Object
Description:N/A
GetHashCode()
Return Value
Type:Int32
Description:N/A
Parameters
GetType()
Return Value
Type:Type
Description:N/A
Parameters
FillBackground(GeoImage,GeoBrush)
Return Value
Type:Void
Description:None
Parameters
ConvertGeoImageToMemoryStream(GeoImage)
Return Value
Parameters
ConvertGeoImageToMemoryStream(GeoImage,ImageFormat)
Return Value
Parameters
CreateGeoImage(Int32,Int32)
Return Value
Parameters
Protected Methods
DrawAreaCore(IEnumerable<ScreenPointF[]>,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
This method is used to draw on the GeoCanvas. It provides you with a number of overloads that allow you to control how things are drawn. Specify the GeoBrush to fill in an area. Specify the GeoPen to outline an area using that GeoPen. You can also call an overload that will allow you to specify both a GeoPen and a GeoBrush.The DrawingLevel allows you to specify the level you will draw on when you are drawing multiple areas. This is very useful when you want to draw a drop shadow, for example. In that case, you could draw the black backdrop on the lowest level with an offset, then draw the normal shape on a higher level without an offset.
Return Value
Type:Void
Description:N/A
Parameters
DrawLineCore(IEnumerable<ScreenPointF>,GeoPen,DrawingLevel,Single,Single)
This method is used to draw a line on the GeoCanvas using the specified GeoPen.The DrawingLevel allows you to specify the level you will draw on when drawing multiple lines. This is very useful when you want to draw a road, for example. You can draw the black background on the lowest level, then draw a slightly thinner white line on a higher level. This will result in a great effect for a road.
Return Value
Type:Void
Description:N/A
Parameters
DrawEllipseCore(ScreenPointF,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)
Return Value
Type:Void
Description:N/A
Parameters
DrawScreenImageWithoutScalingCore(GeoImage,Single,Single,DrawingLevel,Single,Single,Single)
Drawing an image unscaled is faster than using the API that scales it.
Return Value
Type:Void
Description:N/A
Parameters
DrawScreenImageCore(GeoImage,Single,Single,Single,Single,DrawingLevel,Single,Single,Single)
Drawing an image scaled is slower than using the API that draws it unscaled.
Return Value
Type:Void
Description:N/A
Parameters
DrawTextCore(String,GeoFont,GeoBrush,GeoPen,IEnumerable<ScreenPointF>,DrawingLevel,Single,Single,Single)
This method is used to draw text on the GeoCanvas.The DrawingLevel allows you to specify the level you will draw on when drawing multiple text items. This is very useful when you want to draw a drop shadow, for example. You can draw the black backdrop on the lowest level with an offset, then draw the normal text on a higher level without an offset.
Return Value
Type:Void
Description:N/A
Parameters
MeasureTextCore(String,GeoFont)
Return Value
Parameters
BeginDrawingCore(Object,RectangleShape,GeographyUnit)
Return Value
Type:Void
Description:N/A
Parameters
EndDrawingCore()
This method should be called when you are finished drawing. It will commit the image changes to the image you passed in on BeginDrawing. It will also set IsDrawing to false. After you call this method it will put the GeoCanvas into an invalid state, so if you then call any drawing methods it will raise an exception.
Return Value
Type:Void
Description:N/A
Parameters
FlushCore()
This method should be called when you are finished drawing. It will commit the image changes to the image you passed in on BeginDrawing. It will also set IsDrawing to false. After you call this method it will put the GeoCanvas into an invalid state, so if you then call any drawing methods it will raise an exception.
Return Value
Type:Void
Description:N/A
Parameters
ToNativeImageCore(GeoImage)
It is faster to provide a native image object to the canvas for drawing. In some cases, you may not know what the native image type is. For example, for GDI+ it is a bitmap class, but in GDI it may be a handled to an HBitmap. If you are not sure how to create the native image object, you should first create a GeoImage and then call this method and it will pass back the native image object. You can then use it to get excellent drawing performance on the GeoCanvas.
Return Value
Parameters
ToGeoImageCore(Object)
This method will allows you to convert your native image object to a GeoImage. Many times, when you work with a GeoCanvas, you may not know the format of the native image. Using this method you can always convert it back to a GeoImage, which is a stream of a TIFF.
Return Value
Parameters
DrawEvalWaterMarked(String)
Return Value
Type:Void
Description:N/A
Parameters
waterMarkedString
Type:String
Description:N/A
DrawFullWaterMarked(String)
Return Value
Type:Void
Description:N/A
Parameters
waterMarkedString
Type:String
Description:N/A
GetCanvasWidthCore(Object)
Return Value
Parameters
GetCanvasHeightCore(Object)
Return Value
Parameters
OnDrawingProgressChanged(DrawingProgressChangedEventArgs)
Return Value
Type:Void
Description:N/A
Parameters
ToWorldCoordinate(DrawingRectangleF)
Return Value
Parameters
CloneDeepCore()
Return Value
Parameters
ClearCore(GeoBrush)
Return Value
Type:Void
Description:N/A
Parameters
GetCanvasWidth(Object)
Return Value
Type:Single
Description:N/A
Parameters
nativeImage
Type:Object
Description:N/A
GetCanvasHeight(Object)
Return Value
Type:Single
Description:N/A
Parameters
nativeImage
Type:Object
Description:N/A
Finalize()
Return Value
Type:Void
Description:N/A
Parameters
MemberwiseClone()
Return Value
Type:Object
Description:N/A
Parameters
Public Properties
CompositingQuality
This property returns or sets the quality level to use during compositing.
This property is used for GDI+ drawing. The excerpt below is from the GDI+ documentation: Compositing is done during rendering when the source pixels are combined with the destination pixels to produce the resultant pixels. The quality of compositing directly relates to the visual quality of the output and is inversely proportional to the render time. The higher the quality, the slower the render time. This is because the higher the quality level, the more surrounding pixels need to be taken into account during the composite. The linear quality setting (AssumeLinear) compromises by providing better quality than the default quality at a slightly lower speed.
Return Value
SmoothingMode
This property returns or sets the rendering quality for this GeoCanvas.
This property is used for GDI+ drawing. The excerpt below is from the GDI+ documentation: The smoothing mode specifies whether lines, curves, and the edges of filled areas use smoothing (also called antialiasing). One exception is that path gradient brushes do not obey the smoothing mode. Areas filled using a PathGradientBrush are rendered the same way (aliased) regardless of the SmoothingMode property.
Return Value
HasKeyColor
This property indicates whether a GdiPlusGeoCanvas has the KeyColor or not. If it has no KeyColor, it will throw an exception when you get or set the value of KeyColors property.
The default value is true.
Return Value
TextRenderingHint
This property returns or sets the rendering mode for text associated with this GeoCanvas.
This property is used for GDI+ drawing. The excerpt below is from the GDI+ documentation: The text rendering hint specifies whether text renders with antialiasing.
Return Value
InterpolationMode
Gets or sets the interpolation mode associated with this System.Drawing.Graphics.
Return Value
ClippingArea
N/A
Return Value
CurrentScale
N/A
Return Value
DrawingQuality
N/A
Return Value
MapUnit
N/A
Return Value
Width
N/A
Return Value
Height
N/A
Return Value
CurrentWorldExtent
N/A
Return Value
KeyColors
N/A
Return Value
NativeImage
N/A
Return Value
IsDrawing
N/A
Return Value
Dpi
N/A
Return Value
Protected Properties
HasDrawn
N/A
Return Value
Public Events
DrawingProgressChanged
N/A