SKAutoCanvasRestore Class
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Convenience class used to restore the canvas state in a using statement.
public class SKAutoCanvasRestore : IDisposable
- Inheritance
-
SKAutoCanvasRestore
- Implements
SKCanvas canvas = ...;
using (new SKAutoCanvasRestore(canvas)) {
// perform some transform
canvas.RotateDegrees(45);
// draw as usual
var paint = new SKPaint ();
canavs.DrawRect (10, 10, 100, 100, paint);
// automatically restore to original transform
}
This class can be used in a using statement to save the state of the canvas (matrix, clip and draw filter) allowing you to change these components and have them automatically undone by virtue of having the Dispose() method restore the canvas state to the state it was when this instance was created.
SKAuto |
Creates a canvas restore point. |
SKAuto |
Creates a canvas restore point, invoking the Save() method. |
Dispose() |
Disposes the canvas restore point, restoring the state of the canvas (matrix, clip and draw filter) to the state it was when the object was created. This operation will not do anything if you had previously manually called the Restore() method. |
Restore() |
Restores the canvas restore point, restoring the state of the canvas (matrix, clip and draw filter) to the state it was when the object was creatd. |
Producto | Versiones |
---|---|
SkiaSharp | 1.60.x, 1.68.x, 2.80.x, 2.88.x |
Comentarios de SkiaSharp
SkiaSharp es un proyecto de código abierto. Seleccione un vínculo para proporcionar comentarios: