diff --git a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs index 1ac5c5a1..416adb9b 100644 --- a/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs +++ b/Source/Examples/WinForms/W02_Immediate_Mode_Cube.cs @@ -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