SKGLView Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A Blazor component that provides a GPU-accelerated SkiaSharp drawing surface using WebGL.
public class SKGLView : Microsoft.AspNetCore.Components.ComponentBase, IDisposable
- Inheritance
-
SKGLView
- Implements
Remarks
This component renders to an HTML canvas element using WebGL for hardware-accelerated graphics. It provides better performance than SKCanvasView for complex scenes and animations, but requires WebGL support in the browser.
Constructors
| Name | Description |
|---|---|
| SKGLView() |
Initializes a new instance of the SKGLView 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. |