Läs på engelska Redigera

Dela via


SKCanvasView Class

Definition

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

C#
public class SKCanvasView : Android.Views.View
Inheritance
SKCanvasView

Constructors

SKCanvasView(Context, IAttributeSet, Int32)

Perform inflation from XML and apply a class-specific base style from a theme attribute.

SKCanvasView(Context, IAttributeSet)

Constructor that is called when inflating a SKCanvasView from XML.

SKCanvasView(Context)

Simple constructor to use when creating a SKCanvasView from code.

SKCanvasView(IntPtr, JniHandleOwnership)

A constructor used when creating managed representations of JNI objects; called by the runtime.

Properties

CanvasSize

Gets the current canvas size.

IgnorePixelScaling

Gets or sets a value indicating whether the drawing canvas should be resized on high resolution displays.

Methods

Dispose(Boolean)

Releases the unmanaged resources used by the SKCanvasView and optionally releases the managed resources.

OnAttachedToWindow()
OnDetachedFromWindow()

This is called when the view is detached from a window.

OnDraw(Canvas)

Implement this to do your drawing.

OnDraw(SKSurface, SKImageInfo)
Obsolete.

Implement this to draw on the canvas.

OnPaintSurface(SKPaintSurfaceEventArgs)

Implement this to draw on the canvas.

OnSizeChanged(Int32, Int32, Int32, Int32)

This is called during layout when the size of this view has changed. If you were just added to the view hierarchy, you're called with the old values of 0.

Events

PaintSurface

Occurs when the the canvas needs to be redrawn.

Applies to

Produkt Versioner
SkiaSharp Views 1.60.x, 1.68.x, 2.80.x, 2.88.x