SkiaSharp.Views.Forms.SKCanvasView Class

A view that can be drawn on using SkiaSharp drawing commands.

See Also: SKCanvasView

Syntax

[Xamarin.Forms.RenderWith(typeof(SkiaSharp.Views.Forms.SKCanvasViewRenderer))]
public class SKCanvasView : View

Remarks

Requirements

Namespace: SkiaSharp.Views.Forms
Assembly: SkiaSharp.Views.Forms (in SkiaSharp.Views.Forms.dll)
Assembly Versions: 1.55.0.0, 1.56.0.0, 1.57.0.0, 1.58.0.0, 1.59.0.0

The members of SkiaSharp.Views.Forms.SKCanvasView are listed below.

See Also: View

Public Constructors

Creates a new instance of the SKCanvasView view.

Public Fields

static readonly
EnableTouchEventsPropertyBindableProperty. Implements the SKCanvasView.EnableTouchEvents property, and allows the SKCanvasView class to bind it to properties on other objects at run time.
static readonly
IgnorePixelScalingPropertyBindableProperty. Implements the SKCanvasView.IgnorePixelScaling property, and allows the SKCanvasView class to bind it to properties on other objects at run time.

Public Properties

[read-only]
CanvasSizeSKSize. Gets the current canvas size.
EnableTouchEventsBoolean. Gets or sets a value indicating whether or not to enable touch events for this view.
IgnorePixelScalingBoolean. Gets or sets a value indicating whether the drawing canvas should be resized on high resolution displays.

Public Methods

InvalidateSurface()
Informs the canvas that it needs to redraw itself.

Protected Methods

override
OnMeasure(Double, Double) : SizeRequest
Method that is called when a layout measurement happens.
OnPaintSurface(SKPaintSurfaceEventArgs)
Implement this to draw on the canvas.
OnTouch(SKTouchEventArgs)
Implement this to handle touch events on the canvas.

Public Events

PaintSurfaceOccurs when the the canvas needs to be re-drawn.
TouchOccurs when the the canvas received a touch event.