In This Article

DoubleBufferCanvas Class

Provides a canvas to use for double-buffered painting.

public class DoubleBufferCanvas : DisposableObjectBase, IDoubleBufferCanvas, IDisposable
Inheritance:
object DisposableObjectBase object
Implements:
IDoubleBufferCanvas IDisposable

Constructors

DoubleBufferCanvas(Control)

Provides a canvas to use for double-buffered painting.

public DoubleBufferCanvas(Control control)
Parameter Type Description
control Control

The Control that is using the canvas.

Properties

Graphics

The Graphics object to use for all drawing operations.

public Graphics? Graphics { get; }

Property Value

Graphics

Methods

Copy(Rectangle, Point)

Copies one area of the canvas to another.

public void Copy(Rectangle sourceRect, Point destinationLocation)
Parameter Type Description
sourceRect Rectangle

A Rectangle specifying the source bounds to copy.

destinationLocation Point

A Point specifying the destination location.

Dispose(bool)

Releases the unmanaged resources used by the object and optionally releases the managed resources.

protected override void Dispose(bool disposing)
Parameter Type Description
disposing bool

true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks

This method is called by the public Dispose() method and the Finalize method. Dispose invokes this method with the disposing parameter set to true. Finalize invokes this method with disposing set to false.

Flush()

Flushes the contents of the double-buffer canvas back to the original Graphics object.

public void Flush()

Invert(Rectangle)

Inverts the specified bounds in the canvas.

public void Invert(Rectangle bounds)
Parameter Type Description
bounds Rectangle

A Rectangle specifying the bounds to invert.

PrepareGraphics(PaintEventArgs)

Prepares the double-buffer canvas for drawing.

public void PrepareGraphics(PaintEventArgs e)
Parameter Type Description
e PaintEventArgs

The event data.

Reset()

Resets the Graphics and canvas.

public void Reset()

Inherited Members

Extension Methods