Table of Contents

Class CachedObject

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public class CachedObject : ISkiaDisposable, IDisposable
Inheritance
CachedObject
Implements
Inherited Members
Extension Methods

Constructors

CachedObject(SkiaCacheType, SKPicture, SKRect, SKRect)

public CachedObject(SkiaCacheType type, SKPicture picture, SKRect bounds, SKRect recordingArea)

Parameters

type SkiaCacheType
picture SKPicture
bounds SKRect
recordingArea SKRect

CachedObject(SkiaCacheType, SKSurface, SKRect, SKRect)

public CachedObject(SkiaCacheType type, SKSurface surface, SKRect bounds, SKRect recordingArea)

Parameters

type SkiaCacheType
surface SKSurface
bounds SKRect
recordingArea SKRect

Fields

Id

public Guid Id

Field Value

Guid

LastDestination

Actual destination rect where cache was drawn (for gesture coordinate translation)

public SKRect LastDestination

Field Value

SKRect

LastDrawnAt

Stores the canvas-relative draw position(x, y), not the actual destination rect, these are relative offsets for the drawing operation, not absolute screen position.

public SKRect LastDrawnAt

Field Value

SKRect

Properties

Bounds

public SKRect Bounds { get; set; }

Property Value

SKRect

Children

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

Property Value

List<VisualLayer>

Image

public SKImage Image { get; set; }

Property Value

SKImage

IsAlive

public ObjectAliveType IsAlive { get; set; }

Property Value

ObjectAliveType

IsDisposed

public bool IsDisposed { get; protected set; }

Property Value

bool

Picture

public SKPicture Picture { get; set; }

Property Value

SKPicture

PreserveSourceFromDispose

public bool PreserveSourceFromDispose { get; set; }

Property Value

bool

RecordingArea

public SKRect RecordingArea { get; set; }

Property Value

SKRect

Surface

public SKSurface Surface { get; set; }

Property Value

SKSurface

SurfaceIsRecycled

An existing surface was reused for creating this object

public bool SurfaceIsRecycled { get; set; }

Property Value

bool

Tag

public string Tag { get; set; }

Property Value

string

Type

public SkiaCacheType Type { get; protected set; }

Property Value

SkiaCacheType

Methods

CalculatePositionOffset(SKPoint)

public SKPoint CalculatePositionOffset(SKPoint drawingRect)

Parameters

drawingRect SKPoint

Returns

SKPoint

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Draw(SKCanvas, SKRect, SKPaint)

This will draw with destination corrected by offset that it had when was recorded

public void Draw(SKCanvas canvas, SKRect destination, SKPaint paint)

Parameters

canvas SKCanvas
destination SKRect
paint SKPaint

Draw(SKCanvas, float, float, SKPaint)

Will draw at exact x,y coordinated without any adjustments

public void Draw(SKCanvas canvas, float x, float y, SKPaint paint)

Parameters

canvas SKCanvas
x float
y float
paint SKPaint

GetBitmap()

public SKBitmap GetBitmap()

Returns

SKBitmap

Test(SKRect)

public SKPoint Test(SKRect drawingRect)

Parameters

drawingRect SKRect

Returns

SKPoint

TranslateInputCoords(SKRect)

public SKPoint TranslateInputCoords(SKRect drawingRect)

Parameters

drawingRect SKRect

Returns

SKPoint