Table of Contents

Class VisualLayer

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public class VisualLayer
Inheritance
VisualLayer
Inherited Members
Extension Methods

Constructors

VisualLayer()

protected VisualLayer()

VisualLayer(SkiaControl, VisualLayer, SKRect, float)

Create this ONLY when DrawingRect and RenderTransformMatrix are ready

public VisualLayer(SkiaControl control, VisualLayer parent, SKRect destination, float scale)

Parameters

control SkiaControl
parent VisualLayer
destination SKRect
scale float

Properties

Cache

Cached rendering object, null means render control directly

public CachedObject Cache { get; set; }

Property Value

CachedObject

Cached

Type of caching applied to this layer

public SkiaCacheType Cached { get; set; }

Property Value

SkiaCacheType

Children

Child layers contained within this layer

public List<VisualLayer> Children { get; set; }

Property Value

List<VisualLayer>

Control

The SkiaControl this layer represents

public SkiaControl Control { get; set; }

Property Value

SkiaControl

Destination

Layout bounds in local coordinates

public SKRect Destination { get; set; }

Property Value

SKRect

HitBox

A hitbox rather for internal use, because it is same as LastDrawnAt. For exact position on canvas use HitBoxWithTransforms.

public ScaledRect HitBox { get; set; }

Property Value

ScaledRect

HitBoxWithTransforms

Exact position on canvas use HitBoxWithTransforms, all matrix transforms and Left, Top offset applied.

public ScaledRect HitBoxWithTransforms { get; set; }

Property Value

ScaledRect

IsFrozen

Child of a cached object

public bool IsFrozen { get; set; }

Property Value

bool

OpacityTotal

Combined opacity including all parent opacities

public double OpacityTotal { get; set; }

Property Value

double

Origin

Layout bounds in local coordinates at time of creation

public SKRect Origin { get; }

Property Value

SKRect

RotationTotal

Total rotation in degrees extracted from transform matrix

public double RotationTotal { get; set; }

Property Value

double

ScaleTotal

Total scale factors extracted from transform matrix

public SKPoint ScaleTotal { get; set; }

Property Value

SKPoint

Transforms

Local transformation matrix applied to this layer

public SKMatrix Transforms { get; protected set; }

Property Value

SKMatrix

TransformsTotal

Combined transformation matrix including all parent transforms

public SKMatrix TransformsTotal { get; protected set; }

Property Value

SKMatrix

TranslationTotal

Total translation extracted from transform matrix

public SKPoint TranslationTotal { get; set; }

Property Value

SKPoint

Methods

AttachFromCache(CachedObject)

Attaches cached children and relocates them to account for new parent position

public void AttachFromCache(CachedObject cache)

Parameters

cache CachedObject

Cached object containing children to attach

CreateEmpty()

public static VisualLayer CreateEmpty()

Returns

VisualLayer

DecomposeMatrix(SKMatrix, out SKPoint, out float, out SKPoint)

public static void DecomposeMatrix(SKMatrix m, out SKPoint scale, out float rotation, out SKPoint translation)

Parameters

m SKMatrix
scale SKPoint
rotation float
translation SKPoint

Render(DrawingContext)

public void Render(DrawingContext context)

Parameters

context DrawingContext

TransformRect(SKRect, SKMatrix)

Helper to transform a rectangle using a matrix

public static SKRect TransformRect(SKRect rect, SKMatrix matrix)

Parameters

rect SKRect
matrix SKMatrix

Returns

SKRect