Skip to content

WpfDrawingGeoCanvas

Namespace: ThinkGeo.UI.Wpf

WPF implementation of GeoCanvas that uses a GeoGraphicsView for drawing. Implements IGeoCanvasRotatable to support rotation of drawing operations.

public class WpfDrawingGeoCanvas : ThinkGeo.Core.GeoCanvas, ThinkGeo.Core.IGeoCanvasRotatable

Inheritance object → GeoCanvas → WpfDrawingGeoCanvas
Implements IGeoCanvasRotatable

Properties

RotationAngle

public double RotationAngle { get; set; }

Property Value

double

PivotX

public double PivotX { get; set; }

Property Value

double

PivotY

public double PivotY { get; set; }

Property Value

double

ScaleFactor

public float ScaleFactor { get; }

Property Value

float

CurrentScale

public double CurrentScale { get; }

Property Value

double

FontDisplayDensity

public double FontDisplayDensity { get; }

Property Value

double

DrawingQuality

public DrawingQuality DrawingQuality { get; set; }

Property Value

DrawingQuality

MapUnit

public GeographyUnit MapUnit { get; }

Property Value

GeographyUnit

Width

public float Width { get; protected set; }

Property Value

float

Height

public float Height { get; protected set; }

Property Value

float

CurrentWorldExtent

public RectangleShape CurrentWorldExtent { get; protected set; }

Property Value

RectangleShape

SupportKeyColor

public bool SupportKeyColor { get; }

Property Value

bool

KeyColors

public Collection<GeoColor> KeyColors { get; }

Property Value

Collection<GeoColor>

NativeImage

public object NativeImage { get; }

Property Value

object

IsDrawing

public bool IsDrawing { get; protected set; }

Property Value

bool

Dpi

public float Dpi { get; set; }

Property Value

float

CancellationToken

public CancellationToken CancellationToken { get; set; }

Property Value

CancellationToken

ClippingArea

public RectangleShape ClippingArea { get; set; }

Property Value

RectangleShape

Constructors

WpfDrawingGeoCanvas()

public WpfDrawingGeoCanvas()

Methods

DrawArcCore(GeoPen, float, float, float, float, float, float, DrawingLevel)

Draws an arc. (Not implemented)

protected void DrawArcCore(GeoPen pen, float x, float y, float width, float height, float startAngle, float sweepAngle, DrawingLevel drawingLevel)

Parameters

pen GeoPen

x float

y float

width float

height float

startAngle float

sweepAngle float

drawingLevel DrawingLevel

Returns

void

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

Draws a filled/stroked polygon (area) by transforming each set of points.

protected void DrawAreaCore(IEnumerable<ScreenPointF[]> screenPoints, GeoPen outlinePen, GeoBrush fillBrush, DrawingLevel drawingLevel, float xOffset, float yOffset, PenBrushDrawingOrder penBrushDrawingOrder)

Parameters

screenPoints IEnumerable<ScreenPointF[]>

outlinePen GeoPen

fillBrush GeoBrush

drawingLevel DrawingLevel

xOffset float

yOffset float

penBrushDrawingOrder PenBrushDrawingOrder

Returns

void

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

Draws a polyline by applying rotation to the provided screen points.

protected void DrawLineCore(IEnumerable<ScreenPointF> screenPoints, GeoPen linePen, DrawingLevel drawingLevel, float xOffset, float yOffset)

Parameters

screenPoints IEnumerable<ScreenPointF>

linePen GeoPen

drawingLevel DrawingLevel

xOffset float

yOffset float

Returns

void

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

Draws an ellipse at the given screen point.

protected void DrawEllipseCore(ScreenPointF screenPoint, float width, float height, GeoPen outlinePen, GeoBrush fillBrush, DrawingLevel drawingLevel, float xOffset, float yOffset, PenBrushDrawingOrder penBrushDrawingOrder)

Parameters

screenPoint ScreenPointF

width float

height float

outlinePen GeoPen

fillBrush GeoBrush

drawingLevel DrawingLevel

xOffset float

yOffset float

penBrushDrawingOrder PenBrushDrawingOrder

Returns

void

DrawScreenImageWithoutScalingCore(GeoImage, float, float, DrawingLevel, float, float, float, RasterResamplingMode)

Draws an image without scaling. (Not implemented)

protected void DrawScreenImageWithoutScalingCore(GeoImage image, float centerXInScreen, float centerYInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle, RasterResamplingMode resamplingMode)

Parameters

image GeoImage

centerXInScreen float

centerYInScreen float

drawingLevel DrawingLevel

xOffset float

yOffset float

rotateAngle float

resamplingMode RasterResamplingMode

Returns

void

DrawScreenImageCore(GeoImage, float, float, float, float, DrawingLevel, float, float, float, RasterResamplingMode)

Draws an image with scaling. (Not implemented)

protected void DrawScreenImageCore(GeoImage image, float centerXInScreen, float centerYInScreen, float widthInScreen, float heightInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle, RasterResamplingMode resamplingMode)

Parameters

image GeoImage

centerXInScreen float

centerYInScreen float

widthInScreen float

heightInScreen float

drawingLevel DrawingLevel

xOffset float

yOffset float

rotateAngle float

resamplingMode RasterResamplingMode

Returns

void

DrawTextCore(string, GeoFont, GeoBrush, GeoPen, IEnumerable<ScreenPointF>, DrawingLevel, float, float, DrawingTextAlignment, float)

Draws text by delegating to the GeoGraphicsView.

protected void DrawTextCore(string text, GeoFont font, GeoBrush fillBrush, GeoPen haloPen, IEnumerable<ScreenPointF> textPathInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, DrawingTextAlignment drawingTextAlignment, float rotateAngle)

Parameters

text string

font GeoFont

fillBrush GeoBrush

haloPen GeoPen

textPathInScreen IEnumerable<ScreenPointF>

drawingLevel DrawingLevel

xOffset float

yOffset float

drawingTextAlignment DrawingTextAlignment

rotateAngle float

Returns

void

MeasureTextCore(string, GeoFont)

Measures the size of text using WPF's layout engine for consistent rendering.

protected DrawingRectangleF MeasureTextCore(string text, GeoFont font)

Parameters

text string

font GeoFont

Returns

DrawingRectangleF

BeginDrawingCore(object, RectangleShape, GeographyUnit)

Begins a drawing session by initializing the GeoGraphicsView.

protected void BeginDrawingCore(object nativeImage, RectangleShape worldExtent, GeographyUnit drawingMapUnit)

Parameters

nativeImage object

worldExtent RectangleShape

drawingMapUnit GeographyUnit

Returns

void

GetCanvasWidthCore()

This returns the virtual width (instead of physical width) of the canvas, the scale factor of this geoCanvas is always 1.

protected float GetCanvasWidthCore()

Returns

float

GetCanvasHeightCore()

This returns the virtual height (instead of physical height) of the canvas, the scale factor of this geoCanvas is always 1.

protected float GetCanvasHeightCore()

Returns

float

EndDrawingCore()

Ends the drawing session.

protected void EndDrawingCore()

Returns

void

FlushCore()

Flushes any pending drawing operations.

protected void FlushCore()

Returns

void

Events

DrawingProgressChanged

public event EventHandler<DrawingProgressChangedEventArgs> DrawingProgressChanged;