SKCanvas.SaveLayer Method

Definition

Overloads

SaveLayer()
SaveLayer(SKPaint)

Saves the canvas state and allocates an offscreen bitmap.

SaveLayer(SKRect, SKPaint)

Saves the canvas state and allocates an offscreen bitmap.

SaveLayer()

public int SaveLayer ();

Returns

Int32

SaveLayer(SKPaint)

Saves the canvas state and allocates an offscreen bitmap.

public int SaveLayer (SkiaSharp.SKPaint paint);

Parameters

paint
SKPaint

This is copied, and is applied to the offscreen when Restore() is called.

Returns

Int32

The value to pass to RestoreToCount(Int32) to balance this save.

Remarks

This behaves the same as Save() but in addition it allocates an offscreen bitmap. All drawing calls are directed there, and only when the balancing call to Restore() is made is that offscreen transfered to the canvas (or the previous layer).

SaveLayer(SKRect, SKPaint)

Saves the canvas state and allocates an offscreen bitmap.

public int SaveLayer (SkiaSharp.SKRect limit, SkiaSharp.SKPaint paint);

Parameters

limit
SKRect

This clipping rectangle hint to limit the size of the offscreen bitmap.

paint
SKPaint

This is copied, and is applied to the offscreen when Restore() is called.

Returns

Int32

The value to pass to RestoreToCount(Int32) to balance this save.

Remarks

This behaves the same as Save() but in addition it allocates an offscreen bitmap. All drawing calls are directed there, and only when the balancing call to Restore() is made is that offscreen transfered to the canvas (or the previous layer).

The limit rectangle, is used as a hint to limit the size of the offscreen bitmap, and thus drawing may be clipped to it, though that clipping is not guaranteed to happen. If exact clipping is desired, use ClipRect(SKRect, SKClipOperation, Boolean).

Applies to