Struct DrawingContext
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
ctxSkiaDrawingContextdestinationSKRectscalefloatargumentsobject
Properties
Context
Platform rendering context
public SkiaDrawingContext Context { readonly get; set; }
Property Value
Destination
Destination to use for output
public SKRect Destination { readonly get; set; }
Property Value
Parameters
Optional parameters
public object? Parameters { readonly get; set; }
Property Value
Scale
Scale pixels/points to use for output
public float Scale { readonly get; set; }
Property Value
Methods
CreateForRecordingImage(SKSurface, SKSize)
public DrawingContext CreateForRecordingImage(SKSurface surface, SKSize size)
Parameters
Returns
CreateForRecordingOperations(SKPictureRecorder, SKRect)
public DrawingContext CreateForRecordingOperations(SKPictureRecorder recorder, SKRect cacheRecordingArea)
Parameters
recorderSKPictureRecordercacheRecordingAreaSKRect
Returns
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
keystring
Returns
WithArgument(KeyValuePair<string, object?>?)
public DrawingContext WithArgument(KeyValuePair<string, object?>? kvp)
Parameters
kvpKeyValuePair<string, object>?
Returns
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
valuesKeyValuePair<string, object>[]
Returns
WithContext(SkiaDrawingContext)
public DrawingContext WithContext(SkiaDrawingContext ctx)
Parameters
Returns
WithDestination(SKRect)
public DrawingContext WithDestination(SKRect destination)
Parameters
destinationSKRect
Returns
WithParameters(object)
public DrawingContext WithParameters(object arguments)
Parameters
argumentsobject
Returns
WithScale(float)
public DrawingContext WithScale(float scale)
Parameters
scalefloat