Table of Contents

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()

This method is the default constructor for the GdiPlusGeoCanvas.

Remarks

None

Parameters

Protected Constructors

Public Methods

GetStreamFromGeoImage(GeoImage)

This method returns a stream that represents the GeoImage in TIFF format.

Remarks

This method allows you to get the stream out of a GeoImage. The stream is a memory stream and the bytes are in TIFF format. Once you have the stream, you can then save it to whatever format you need.

Return Value
Parameters

DrawWorldImageWithoutScaling(Bitmap,Double,Double,DrawingLevel)

Draws an unscaled image on the GeoCanvas.

Remarks

Drawing an image unscaled is faster than using the API that scales it.

Return Value
Parameters

DrawWorldImageWithoutScaling(Bitmap,Double,Double,DrawingLevel,Single,Single,Single)

Draws an unscaled image on the GeoCanvas.

Remarks

Drawing an image unscaled is faster than using the API that scales it.

Return Value
Parameters

DrawScreenImageWithoutScaling(Bitmap,Single,Single,DrawingLevel,Single,Single,Single)

Draws an unscaled image on the GeoCanvas.

Remarks

Drawing an image unscaled is faster than using the API that scales it.

Return Value
Parameters

CloneDeep()

N/A

Remarks

N/A

Return Value
Parameters

Clear(GeoBrush)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(Feature,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(AreaBaseShape,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(Feature,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(AreaBaseShape,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(Feature,GeoPen,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(AreaBaseShape,GeoPen,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(Feature,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(AreaBaseShape,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawArea(IEnumerable<ScreenPointF[]>,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawLine(Feature,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawLine(LineBaseShape,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawLine(Feature,GeoPen,DrawingLevel,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawLine(LineBaseShape,GeoPen,DrawingLevel,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawLine(IEnumerable<ScreenPointF>,GeoPen,DrawingLevel,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(Feature,Single,Single,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(PointBaseShape,Single,Single,GeoPen,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(Feature,Single,Single,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(PointBaseShape,Single,Single,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(Feature,Single,Single,GeoPen,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(PointBaseShape,Single,Single,GeoPen,GeoBrush,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(Feature,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(PointBaseShape,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawEllipse(ScreenPointF,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

N/A

Remarks

N/A

Return Value
Parameters

DrawWorldImageWithoutScaling(GeoImage,Double,Double,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawWorldImageWithoutScaling(GeoImage,Double,Double,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawScreenImageWithoutScaling(GeoImage,Single,Single,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawWorldImage(GeoImage,Double,Double,Single,Single,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawWorldImage(GeoImage,Double,Double,Double,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawWorldImage(GeoImage,Double,Double,Single,Single,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawScreenImage(GeoImage,Single,Single,Single,Single,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

DrawTextWithScreenCoordinate(String,GeoFont,GeoBrush,Single,Single,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawTextWithScreenCoordinate(String,GeoFont,GeoBrush,GeoPen,Single,Single,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawTextWithWorldCoordinate(String,GeoFont,GeoBrush,Double,Double,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawTextWithWorldCoordinate(String,GeoFont,GeoBrush,GeoPen,Double,Double,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawText(String,GeoFont,GeoBrush,IEnumerable<ScreenPointF>,DrawingLevel)

N/A

Remarks

N/A

Return Value
Parameters

DrawText(String,GeoFont,GeoBrush,GeoPen,IEnumerable<ScreenPointF>,DrawingLevel,Single,Single,Single)

N/A

Remarks

N/A

Return Value
Parameters

MeasureText(String,GeoFont)

N/A

Remarks

N/A

Return Value
Parameters

BeginDrawing(Object,RectangleShape,GeographyUnit)

N/A

Remarks

N/A

Return Value
Parameters

ToNativeImage(GeoImage)

N/A

Remarks

N/A

Return Value
Parameters

ToGeoImage(Object)

N/A

Remarks

N/A

Return Value
Parameters

EndDrawing()

N/A

Remarks

N/A

Return Value
Parameters

Flush()

N/A

Remarks

N/A

Return Value
Parameters

ToString()

N/A

Remarks

N/A

Return Value
Parameters

Equals(Object)

N/A

Remarks

N/A

Return Value
Parameters

GetHashCode()

N/A

Remarks

N/A

Return Value
Parameters

GetType()

N/A

Remarks

N/A

Return Value
Parameters

FillBackground(GeoImage,GeoBrush)

This method fills the specified GeoImage with the specified GeoBrush.

Remarks

This method allows you to fill a GeoImage with the specific fill style of the GeoBrush you pass in. It is useful for setting backgrounds.

Return Value
Parameters

ConvertGeoImageToMemoryStream(GeoImage)

This method converts a GeoImage to a memory stream.

Remarks

This method is used to get a TIFF memory stream from a GeoImage using the canvas-specific methods. If you need to get a format other than TIFF, you can use the other overload which allows you to specify the output format.

Return Value
Parameters

ConvertGeoImageToMemoryStream(GeoImage,ImageFormat)

This method converts a GeoImage to a memory stream.

Remarks

This method allows you to save the GeoImage to any format you specify. This allows you to convert it to a PNG, or a variety of other formats, and then save it to disk.

Return Value
Parameters

CreateGeoImage(Int32,Int32)

This method returns a GeoImage based on the height and width you provide.

Remarks

You can use this static member to easily create a GeoCanvas.

Return Value
Parameters

Protected Methods

DrawAreaCore(IEnumerable<ScreenPointF[]>,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

This method draws the area on the GeoCanvas.

Remarks

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
Parameters

DrawLineCore(IEnumerable<ScreenPointF>,GeoPen,DrawingLevel,Single,Single)

Draws a LineShape on the GeoCanvas.

Remarks

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
Parameters

DrawEllipseCore(ScreenPointF,Single,Single,GeoPen,GeoBrush,DrawingLevel,Single,Single,PenBrushDrawingOrder)

Draws the point on the GeoCanvas.

Remarks

This method is used to draw a point on the GeoCanvas. It provides you with a number of overloads that allow you to control how it is drawn. Specify the GeoBrush to fill in the area of the point. Specify the GeoPen to outline the point using that GeoPen. You can also call a 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 drawing many points.

Return Value
Parameters

DrawScreenImageWithoutScalingCore(GeoImage,Single,Single,DrawingLevel,Single,Single,Single)

Draws an unscaled image on the GeoCanvas.

Remarks

Drawing an image unscaled is faster than using the API that scales it.

Return Value
Parameters

DrawScreenImageCore(GeoImage,Single,Single,Single,Single,DrawingLevel,Single,Single,Single)

Draws a scaled image on the GeoCanvas.

Remarks

Drawing an image scaled is slower than using the API that draws it unscaled.

Return Value
Parameters

DrawTextCore(String,GeoFont,GeoBrush,GeoPen,IEnumerable<ScreenPointF>,DrawingLevel,Single,Single,Single)

This method allows you to draw text at the specified location, using the specified brush and font parameters.

Remarks

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
Parameters

MeasureTextCore(String,GeoFont)

This method returns the rectangle that contains the specified text, when that text is drawn with the specified font.

Remarks

This method is typically used for labeling, to determine whether labels overlap.

Return Value
Parameters

BeginDrawingCore(Object,RectangleShape,GeographyUnit)

This method begins the act of drawing on the GeoCanvas.

Remarks

This is the first method that needs to be called before any drawing takes place. Calling this method will set the IsDrawing property to true. When you finish drawing, you must call EndDrawing to commit the changes to the image.

Return Value
Parameters

EndDrawingCore()

This method ends drawing and commits the drawing on the GeoCanvas.

Remarks

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
Parameters

FlushCore()

This method flush drawing and commits the drawing on the GeoCanvas.

Remarks

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
Parameters

ToNativeImageCore(GeoImage)

This method returns a native image object from the specified GeoCanvas.

Remarks

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 returns a GeoImage from a native image object.

Remarks

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

6xU=(String)

N/A

Remarks

N/A

Return Value
Parameters

7BU=(String)

N/A

Remarks

N/A

Return Value
Parameters

GetCanvasWidthCore(Object)

This method gets the canvas width of the specified native image object.

Remarks

N/A

Return Value
Parameters

GetCanvasHeightCore(Object)

This method gets the canvas height of the specified native image object.

Remarks

N/A

Return Value
Parameters

OnDrawingProgressChanged(DrawingProgressChangedEventArgs)

N/A

Remarks

N/A

Return Value
Parameters

KRY=(DrawingRectangleF)

N/A

Remarks

N/A

Return Value
Parameters

CloneDeepCore()

N/A

Remarks

N/A

Return Value
Parameters

ClearCore(GeoBrush)

N/A

Remarks

N/A

Return Value
Parameters

GetCanvasWidth(Object)

N/A

Remarks

N/A

Return Value
Parameters

GetCanvasHeight(Object)

N/A

Remarks

N/A

Return Value
Parameters

Finalize()

N/A

Remarks

N/A

Return Value
Parameters

MemberwiseClone()

N/A

Remarks

N/A

Return Value
Parameters

Public Properties

CompositingQuality

This property returns or sets the quality level to use during compositing.

Remarks

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.

Remarks

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.

Remarks

The default value is true.

Return Value

TextRenderingHint

This property returns or sets the rendering mode for text associated with this GeoCanvas.

Remarks

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.

Remarks

N/A

Return Value

ClippingArea

N/A

Remarks

N/A

Return Value

CurrentScale

N/A

Remarks

N/A

Return Value

DrawingQuality

N/A

Remarks

N/A

Return Value

MapUnit

N/A

Remarks

N/A

Return Value

Width

N/A

Remarks

N/A

Return Value

Height

N/A

Remarks

N/A

Return Value

CurrentWorldExtent

N/A

Remarks

N/A

Return Value

KeyColors

N/A

Remarks

N/A

Return Value

NativeImage

N/A

Remarks

N/A

Return Value

IsDrawing

N/A

Remarks

N/A

Return Value

Dpi

N/A

Remarks

N/A

Return Value

Protected Properties

IRY=

N/A

Remarks

N/A

Return Value

Public Events

DrawingProgressChanged N/A

Remarks

N/A

Event Arguments:DrawingProgressChangedEventArgs