// Constructor. public DrawingWindowBuffer(IToolkitWindow windowToBuffer) { toolkit = windowToBuffer.Toolkit; widget = windowToBuffer as InputOutputWidget; buffer = null; graphics = null; }
// Delete the buffer object. private void DeleteBuffer() { // Make sure that we dispose of the X graphics object // before we dispose of the buffer. if(graphics != null) { graphics.graphics.Dispose(); } if(buffer != null) { buffer.Dispose(); buffer = null; } }
// Create the buffer object for the widget. private void CreateBuffer(int width, int height) { DeleteBuffer(); buffer = new DoubleBuffer(widget); }