Table of Contents

Class VFSkiaElement

Namespace
VisioForge.Core.UI.WPF.Skins
Assembly
VisioForge.Core.dll

A FrameworkElement that renders its content with SkiaSharp on the CPU and blits the result through a WriteableBitmap.

public class VFSkiaElement : FrameworkElement, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient

Inheritance

Derived

Implements

Inherited Members

Remarks

Handle the VisioForge.Core.UI.WPF.Skins.VFSkiaElement.PaintSurface event (or override VisioForge.Core.UI.WPF.Skins.VFSkiaElement.OnPaintSurface(SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs)) to draw, and call InvalidateVisual() to request a repaint.

Constructors

VFSkiaElement()

Initializes a new instance of the VisioForge.Core.UI.WPF.Skins.VFSkiaElement class.

public VFSkiaElement()

Properties

CanvasSize

Gets the size of the canvas as seen by the paint handler.

public SKSize CanvasSize { get; }

Property Value

SKSize

IgnorePixelScaling

Gets or sets a value indicating whether the canvas works in device-independent units.

public bool IgnorePixelScaling { get; set; }

Property Value

bool

Methods

OnPaintSurface(SKPaintSurfaceEventArgs)

Raises the VisioForge.Core.UI.WPF.Skins.VFSkiaElement.PaintSurface event.

protected virtual void OnPaintSurface(SKPaintSurfaceEventArgs e)

Parameters

e SKPaintSurfaceEventArgs

The SkiaSharp.Views.Desktop.SKPaintSurfaceEventArgs instance containing the event data.

OnRender(DrawingContext)

Renders the element by handing a Skia surface to the paint handler and drawing the result.

protected override void OnRender(DrawingContext drawingContext)

Parameters

drawingContext DrawingContext

The drawing context.

OnRenderSizeChanged(SizeChangedInfo)

Invalidates the visual so the new size is painted.

protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)

Parameters

sizeInfo SizeChangedInfo

The size change information.

PaintSurface

Occurs when the surface needs to be redrawn.

public event EventHandler<SKPaintSurfaceEventArgs> PaintSurface

Event Type

EventHandler<SKPaintSurfaceEventArgs>