Edit

Share via


SKCanvasView Class

Definition

A Blazor component that provides a SkiaSharp drawing surface using software rendering.

public class SKCanvasView : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
Inheritance
SKCanvasView
Implements

Remarks

This component renders to an HTML canvas element using WebAssembly. The drawing surface is CPU-based and renders each frame by transferring pixel data to the browser canvas. For GPU-accelerated rendering, use SKGLView instead.

Constructors

Name Description
SKCanvasView()

Initializes a new instance of the SKCanvasView class.

Properties

Name Description
AdditionalAttributes

Gets or sets additional HTML attributes to apply to the canvas element.

Dpi

Gets the current device pixel ratio (DPI scaling factor).

EnableRenderLoop

Gets or sets a value indicating whether continuous rendering is enabled.

IgnorePixelScaling

Gets or sets a value indicating whether the canvas should ignore the device pixel ratio.

OnPaintSurface

Gets or sets the callback invoked when the canvas needs to be painted.

Methods

Name Description
BuildRenderTree(RenderTreeBuilder)

Renders the component to the render tree.

Dispose()

Releases all resources used by this component.

Invalidate()

Requests a redraw of the canvas.

OnAfterRenderAsync(Boolean)

Called after the component has rendered.

Applies to