Added screenshot capability.

This commit is contained in:
the_fiddler 2008-03-01 13:15:35 +00:00
parent e477631ad7
commit 6213551844

View file

@ -46,6 +46,7 @@ namespace Examples.WinForms
base.OnLoad(e);
glControl.KeyDown += new KeyEventHandler(glControl_KeyDown);
glControl.KeyUp += new KeyEventHandler(glControl_KeyUp);
//glControl.Resize += new EventHandler(glControl_Resize);
glControl.Paint += new PaintEventHandler(glControl_Paint);
@ -62,6 +63,12 @@ namespace Examples.WinForms
//glControl_Resize(glControl, EventArgs.Empty);
}
void glControl_KeyUp(object sender, KeyEventArgs e)
{
if (e.KeyCode == Keys.F12)
glControl.GrabScreenshot().Save("screenshot.png");
}
#endregion
#region OnClosing