public override void SetDimensions(int width, int height)
{
// Call the base.
base.SetDimensions(width, height);
// Resize dib section.
this.dibSection.Resize(width, height, this.BitDepth);
// TODO: We should be able to just use the code below - however we
// get invalid dimension issues at the moment, so recreate for now.
//// Resize the render buffer storage.
//this.framebuffer.Resize(width, height);
this.framebuffer.Dispose();
Framebuffer framebuffer = CreateFramebuffer(width, height);
this.framebuffer = framebuffer;
}