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, IQueryAmbientInheritance
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
IgnorePixelScaling
Gets or sets a value indicating whether the canvas works in device-independent units.
public bool IgnorePixelScaling { get; set; }Property Value
Methods
OnPaintSurface(SKPaintSurfaceEventArgs)
Raises the VisioForge.Core.UI.WPF.Skins.VFSkiaElement.PaintSurface event.
protected virtual void OnPaintSurface(SKPaintSurfaceEventArgs e)Parameters
eSKPaintSurfaceEventArgs-
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
drawingContextDrawingContext-
The drawing context.
OnRenderSizeChanged(SizeChangedInfo)
Invalidates the visual so the new size is painted.
protected override void OnRenderSizeChanged(SizeChangedInfo sizeInfo)Parameters
sizeInfoSizeChangedInfo-
The size change information.
PaintSurface
Occurs when the surface needs to be redrawn.
public event EventHandler<SKPaintSurfaceEventArgs> PaintSurface