In This Article

DoubleBufferCanvas Class

Provides a canvas to use for double-buffered painting.

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

Constructors

DoubleBufferCanvas(Control)

Creates a new instance of the DoubleBufferCanvas class.

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:

A Graphics object to use for all drawing operations.

Methods

Copy(Rectangle, Point)

Copies one area of the canvas to another.

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

A Rectangle specifying the source bounds to copy.

destLocation Point

A Point specifying the destination location.

Dispose()

Disposes any resources used by the object.

public void Dispose()

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 PaintEventArgs passed to the Paint event.

Reset()

Resets the Graphics and canvas.

public void Reset()

Inherited Members