Added screenshot capability.
This commit is contained in:
parent
e10d37418f
commit
57afab2496
1 changed files with 7 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue