Table of Contents

Class CanvasState

Namespace
ScottPlot
Assembly
ScottPlot.dll

This object manages wraps a SKCanvas and manages calls to SkiaSharp methods to ensure state is tracked across complex render systems.

public class CanvasState
Inheritance
CanvasState
Inherited Members
Extension Methods

Constructors

CanvasState(SKCanvas)

This object manages wraps a SKCanvas and manages calls to SkiaSharp methods to ensure state is tracked across complex render systems.

public CanvasState(SKCanvas canvas)

Parameters

canvas SKCanvas

Properties

SaveLevels

Number of times Save() was called without Restore()

public int SaveLevels { get; set; }

Property Value

int

Methods

Clip(PixelRect)

Clip the canvas so drawing will only occur within the given rectangle.

public void Clip(PixelRect rect)

Parameters

rect PixelRect

DisableClipping()

Restore the canvas to its original state. Disables all clipping and transformations.

public void DisableClipping()

Restore()

Restore the canvas to the state the last time Save() was called. This method will throw if a canvas is restored more times than it was saved. Use the RestoreAll() method to restore a canvas to its original state if the number of saves is unknown.

public void Restore()

RestoreAll()

Restore the canvas to its original state, regardless of how many times Save() was called.

public void RestoreAll()

RotateDegrees(double)

public void RotateDegrees(double degrees)

Parameters

degrees double

RotateDegrees(double, Pixel)

public void RotateDegrees(double degrees, Pixel px)

Parameters

degrees double
px Pixel

RotateRadians(double)

public void RotateRadians(double radians)

Parameters

radians double

RotateRadians(double, Pixel)

public void RotateRadians(double radians, Pixel px)

Parameters

radians double
px Pixel

Save()

Save the current state of the canvas. This state can be recalled by calling Restore().

public void Save()

Translate(Pixel)

public void Translate(Pixel px)

Parameters

px Pixel