graphicsbuffer



struct ResizableGraphicsBuffer;
Resizable graphics buffer.

void start(int width, int height);
void start(Size size);
Start the graphics buffer with its initialial dimensions. The initial bits of the graphics buffer are undefined.

Graphics graphics();
Get the graphics buffer's Graphics to draw on.

bool copyTo(Graphics g);
bool copyTo(Graphics g, Rect clipRect);
Copy the graphics buffer bits to the provided Graphics.

void stop();
Stop the graphics buffer by releasing resources.

bool resize(int width, int height);
void resize(Size size);
Update the dimensions of the graphics buffer.

Returns:
true if the entire area needs to be redrawn and the bits of the graphics buffer are undefined.

Graphics graphicsBuffer();
Property:
get the graphics buffer.

int width();
int height();
Size size();
Property:
get the dimensions of the graphics buffer.

template ControlFixedGraphicsBuffer()
Mixin for a fixed-size, double buffer Control. ControlStyles ALL_PAINTING_IN_WM_PAINT and USER_PAINT must be set.

void onBufferPaint(PaintEventArgs ea);
Override to draw onto the graphics buffer.

void updateGraphics(Rect area);
void updateGraphics();
Updates the double buffer by calling onBufferPaint() and fires a screen-redraw event.

Graphics graphicsBuffer();
Property:
get the graphics buffer. May be null if there is no need for a graphics buffer yet.

invalidate() can be used to fire a screen-redraw event.

void dispose();


template ControlResizableGraphicsBuffer()
Mixin for a variable-size, double buffer Control. ControlStyles ALL_PAINTING_IN_WM_PAINT and USER_PAINT must be set.

void onBufferPaint(PaintEventArgs ea);
Override to draw onto the graphics buffer.

void updateGraphics(Rect area);
void updateGraphics();
Updates the double buffer by calling onBufferPaint() and fires a screen-redraw event.

Graphics graphicsBuffer();
Property:
get the graphics buffer. May be null if there is no need for a graphics buffer yet.

invalidate() can be used to fire a screen-redraw event.

void dispose();


class DoubleBufferedForm: dfl.form.Form;
Mixes in ControlResizableGraphicsBuffer and sets the appropriate styles.

Example:
private import dfl.all
private import graphicsbuffer;

class MyForm: DoubleBufferedForm
{
	protected override void onBufferPaint(PaintEventArgs ea)
	{
		super.onBufferPaint(ea); // Fills the background color.

		// Other painting and drawing to ea.graphics...
	}
}

void main()
{
	Application.run(new MyForm());
}


class DoubleBufferedControl: dfl.usercontrol.UserControl;
Mixes in ControlResizableGraphicsBuffer and sets the appropriate styles.


Page generated by Ddoc.