Table of Contents

Struct DrawingContext

Namespace
DrawnUi.Draw
Assembly
DrawnUi.Maui.dll
public struct DrawingContext
Inherited Members
Extension Methods

Constructors

DrawingContext(SkiaDrawingContext, SKRect, float, object)

public DrawingContext(SkiaDrawingContext ctx, SKRect destination, float scale, object arguments = null)

Parameters

ctx SkiaDrawingContext
destination SKRect
scale float
arguments object

Properties

Context

Platform rendering context

public SkiaDrawingContext Context { readonly get; set; }

Property Value

SkiaDrawingContext

Destination

Destination to use for output

public SKRect Destination { readonly get; set; }

Property Value

SKRect

Parameters

Optional parameters

public object? Parameters { readonly get; set; }

Property Value

object

Scale

Scale pixels/points to use for output

public float Scale { readonly get; set; }

Property Value

float

Methods

CreateForRecordingImage(SKSurface, SKSize)

public DrawingContext CreateForRecordingImage(SKSurface surface, SKSize size)

Parameters

surface SKSurface
size SKSize

Returns

DrawingContext

CreateForRecordingOperations(SKPictureRecorder, SKRect)

public DrawingContext CreateForRecordingOperations(SKPictureRecorder recorder, SKRect cacheRecordingArea)

Parameters

recorder SKPictureRecorder
cacheRecordingArea SKRect

Returns

DrawingContext

GetArgument(string)

Gets the argument associated with the specified key or returns null if not found. Example: if (ctx.GetArgument(ContextArguments.Scale.ToString()) is float zoomedScale) {}

public object? GetArgument(string key)

Parameters

key string

Returns

object

WithArgument(KeyValuePair<string, object?>?)

public DrawingContext WithArgument(KeyValuePair<string, object?>? kvp)

Parameters

kvp KeyValuePair<string, object>?

Returns

DrawingContext

WithArguments(params KeyValuePair<string, object?>[]?)

Will add arguments to parameters, without removing those already existing if they have different keys. To replace all use WithParameters.

public DrawingContext WithArguments(params KeyValuePair<string, object?>[]? values)

Parameters

values KeyValuePair<string, object>[]

Returns

DrawingContext

WithContext(SkiaDrawingContext)

public DrawingContext WithContext(SkiaDrawingContext ctx)

Parameters

ctx SkiaDrawingContext

Returns

DrawingContext

WithDestination(SKRect)

public DrawingContext WithDestination(SKRect destination)

Parameters

destination SKRect

Returns

DrawingContext

WithParameters(object)

public DrawingContext WithParameters(object arguments)

Parameters

arguments object

Returns

DrawingContext

WithScale(float)

public DrawingContext WithScale(float scale)

Parameters

scale float

Returns

DrawingContext