SkiaGeoCanvas¶
Namespace: ThinkGeo.Core
public class SkiaGeoCanvas : GeoCanvas
Inheritance Object → GeoCanvas → SkiaGeoCanvas
Properties¶
SupportKeyColor¶
public bool SupportKeyColor { get; }
Property Value¶
AntiAlias¶
public bool AntiAlias { get; set; }
Property Value¶
CurrentScale¶
This property gets the current scale of the view.
public double CurrentScale { get; }
Property Value¶
Exceptions¶
InvalidOperationException
In the event you attempt to call this property when the GeoCanvas' IsDrawing mode is false, it will throw an InvalidOperationException.
FontDisplayDensity¶
This property gets and sets the current device pixel ratio of platform. It would be used by scale text and icon from map. Android: it's "Application.Context.Resources.DisplayMetrics.Density". iOS: it's "UIScreen.MainScreen.Scale". Others: it's default value "1".
public double FontDisplayDensity { get; }
Property Value¶
DrawingQuality¶
This property returns the drawing quality when rendering on the GeoCanvas.
public DrawingQuality DrawingQuality { get; set; }
Property Value¶
Remarks:
The DrawingQuality specifies whether BaseLineShapes, BasePointShapes, and BaseAreaShapes use anti-aliasing methods or other techniques that control the quality. In some cases you may want a higher quality rendering, and in other cases higher speed is more desirable. It is up to the implementer of the derived GeoCanvas class to control exactly what this setting means.
MapUnit¶
This property returns the MapUnit passed in on the BeginDrawingAPI in the GeoCanvas.
public GeographyUnit MapUnit { get; }
Property Value¶
Width¶
This property gets the width of the view.
public float Width { get; protected set; }
Property Value¶
Exceptions¶
InvalidOperationException
In the event you attempt to call this method when the GeoCanvas' IsDrawing mode is false, it will throw an InvalidOperationException.
Remarks:
This property reflects the width of the view image that was passed in on BeginDrawing.
Height¶
This property gets the height of the view.
public float Height { get; protected set; }
Property Value¶
Exceptions¶
InvalidOperationException
In the event you attempt to call this method when the GeoCanvas' IsDrawing mode is false, it will throw an InvalidOperationException.
Remarks:
This property reflects the height of the view image that was passed in on BeginDrawing.
CurrentWorldExtent¶
This property gets the adjusted current extent based on what was set when BeginDrawing was called.
public RectangleShape CurrentWorldExtent { get; protected set; }
Property Value¶
Exceptions¶
InvalidOperationException
In the event you attempt to call this method when the GeoCanvas' IsDrawing mode is false, it will throw an InvalidOperationException.
Remarks:
The extent that gets passed in on BeginDrawing is adjusted for the height and width of the physical media being drawn on. For example if the current extent is wider than taller but the bitmap being drawn on is square then the current extent needs to be adjusted. The extent will be adjusted larger so that we ensure that the entire original extent will still be represented.
KeyColors¶
Gets a value represents a collection of key colors. If SupportKeyColor property is false, it will throw exception when you use KeyColors.
public Collection<GeoColor> KeyColors { get; }
Property Value¶
Remarks:
It will make these colors transparent when draw image.
NativeImage¶
The same reference to the parameter 'NativeImage' in BeginDrawing function.
public object NativeImage { get; }
Property Value¶
IsDrawing¶
This property gets the drawing status of the GeoCanvas.
public bool IsDrawing { get; protected set; }
Property Value¶
Remarks:
This property is set to true when the BeginDrawing method is called, and false after the EndDrawing method is called.
Dpi¶
The DPI value for the final drawing result, only valid when HasDpi set to true.
public float Dpi { get; set; }
Property Value¶
ScaleFactor¶
Gets or sets the scale factor, this is a value number of device pixels per logical coordinate point.
public float ScaleFactor { get; set; }
Property Value¶
The scale factory value.
Remarks:
The coordinate space used by application developers is measured in logical points. High-resolution (Retina) displays will have more than a single physical pixel per logical point and this property specifies the scale factor.
CancellationToken¶
Gets or sets the cancellation token source.
public CancellationToken CancellationToken { get; set; }
Property Value¶
The cancellation token source.
ClippingArea¶
It's a property only used in printing related Canvas such as PdfGeoCanvas and PrinterGeoCanvas
public RectangleShape ClippingArea { get; set; }
Property Value¶
Constructors¶
SkiaGeoCanvas()¶
public SkiaGeoCanvas()
Methods¶
BeginDrawingCore(Object, RectangleShape, GeographyUnit)¶
protected void BeginDrawingCore(object nativeImage, RectangleShape worldExtent, GeographyUnit drawingMapUnit)
Parameters¶
nativeImage Object
worldExtent RectangleShape
drawingMapUnit GeographyUnit
DrawArcCore(GeoPen, Single, Single, Single, Single, Single, Single, DrawingLevel)¶
protected void DrawArcCore(GeoPen pen, float x, float y, float width, float height, float startAngle, float sweepAngle, DrawingLevel drawingLevel)
Parameters¶
pen GeoPen
x Single
y Single
width Single
height Single
startAngle Single
sweepAngle Single
drawingLevel DrawingLevel
DrawAreaCore(IEnumerable<ScreenPointF[]>, GeoPen, GeoBrush, DrawingLevel, Single, Single, PenBrushDrawingOrder)¶
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 Single
yOffset Single
penBrushDrawingOrder PenBrushDrawingOrder
DrawEllipseCore(ScreenPointF, Single, Single, GeoPen, GeoBrush, DrawingLevel, Single, Single, PenBrushDrawingOrder)¶
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 Single
height Single
outlinePen GeoPen
fillBrush GeoBrush
drawingLevel DrawingLevel
xOffset Single
yOffset Single
penBrushDrawingOrder PenBrushDrawingOrder
DrawLineCore(IEnumerable<ScreenPointF>, GeoPen, DrawingLevel, Single, Single)¶
protected void DrawLineCore(IEnumerable<ScreenPointF> screenPoints, GeoPen linePen, DrawingLevel drawingLevel, float xOffset, float yOffset)
Parameters¶
screenPoints IEnumerable<ScreenPointF>
linePen GeoPen
drawingLevel DrawingLevel
xOffset Single
yOffset Single
DrawScreenImageCore(GeoImage, Single, Single, Single, Single, DrawingLevel, Single, Single, Single)¶
protected void DrawScreenImageCore(GeoImage image, float centerXInScreen, float centerYInScreen, float widthInScreen, float heightInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle)
Parameters¶
image GeoImage
centerXInScreen Single
centerYInScreen Single
widthInScreen Single
heightInScreen Single
drawingLevel DrawingLevel
xOffset Single
yOffset Single
rotateAngle Single
DrawScreenImageWithoutScalingCore(GeoImage, Single, Single, DrawingLevel, Single, Single, Single)¶
protected void DrawScreenImageWithoutScalingCore(GeoImage image, float centerXInScreen, float centerYInScreen, DrawingLevel drawingLevel, float xOffset, float yOffset, float rotateAngle)
Parameters¶
image GeoImage
centerXInScreen Single
centerYInScreen Single
drawingLevel DrawingLevel
xOffset Single
yOffset Single
rotateAngle Single
OnCreatingSKTypefacesForText(CreatingSKTypefacesForTextEventArgs)¶
protected void OnCreatingSKTypefacesForText(CreatingSKTypefacesForTextEventArgs e)
Parameters¶
e CreatingSKTypefacesForTextEventArgs
DrawTextCore(String, GeoFont, GeoBrush, GeoPen, IEnumerable<ScreenPointF>, DrawingLevel, Single, Single, DrawingTextAlignment, Single)¶
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 Single
yOffset Single
drawingTextAlignment DrawingTextAlignment
rotateAngle Single
EndDrawingCore()¶
protected void EndDrawingCore()
FlushCore()¶
protected void FlushCore()
GetCanvasHeightCore()¶
This returns the physical height (instead of virtual height) of the canvas, it equals virtual height multiply scale factor
protected float GetCanvasHeightCore()
Returns¶
GetCanvasWidthCore()¶
This returns the physical width (instead of virtual width) of the canvas, it equals virtual width multiply scale factor
protected float GetCanvasWidthCore()
Returns¶
MeasureTextCore(String, GeoFont)¶
protected DrawingRectangleF MeasureTextCore(string text, GeoFont font)
Parameters¶
text String
font GeoFont
Returns¶
CalculateYOffsetWithTextBaseline(GeoFont, DrawingTextBaseline, String)¶
internal float CalculateYOffsetWithTextBaseline(GeoFont font, DrawingTextBaseline textBaseline, string text)
Parameters¶
font GeoFont
textBaseline DrawingTextBaseline
text String
Returns¶
DrawColorizeImage(GeoImage, Int32, Int32, Int32, Int32, GeoColorMap[], DrawingLevel)¶
internal void DrawColorizeImage(GeoImage image, int srcX, int srcY, int srcWidth, int srcHeight, GeoColorMap[] colors, DrawingLevel drawingLevel)
Parameters¶
image GeoImage
srcX Int32
srcY Int32
srcWidth Int32
srcHeight Int32
colors GeoColorMap[]
drawingLevel DrawingLevel
DrawRadialGradient(ScreenPointF, Int32, Single[], GeoColor[], DrawingLevel)¶
internal void DrawRadialGradient(ScreenPointF centerPoint, int radius, Single[] positions, GeoColor[] colors, DrawingLevel drawingLevel)
Parameters¶
centerPoint ScreenPointF
radius Int32
positions Single[]
colors GeoColor[]
drawingLevel DrawingLevel
GetTypefacesForText(String, GeoFont)¶
internal Collection<SKTypeface> GetTypefacesForText(string text, GeoFont geoFont)
Parameters¶
text String
geoFont GeoFont
Returns¶
Events¶
CreatingSKTypefacesForText¶
public event EventHandler<CreatingSKTypefacesForTextEventArgs> CreatingSKTypefacesForText;
DrawingProgressChanged¶
Occurs when [drawing progress changed].
public event EventHandler<DrawingProgressChangedEventArgs> DrawingProgressChanged;