diff --git a/src/OpenTK.GLControl/GLControl.cs b/src/OpenTK.GLControl/GLControl.cs index 2bb74976..8704c48f 100644 --- a/src/OpenTK.GLControl/GLControl.cs +++ b/src/OpenTK.GLControl/GLControl.cs @@ -6,7 +6,7 @@ // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal -// in the Software without restriction, including without limitation the rights to +// in the Software without restriction, including without limitation the rights to // use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of // the Software, and to permit persons to whom the Software is furnished to do // so, subject to the following conditions: @@ -104,7 +104,7 @@ namespace OpenTK { Backend = PlatformBackend.PreferNative }); - + SetStyle(ControlStyles.Opaque, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.AllPaintingInWmPaint, true); @@ -273,7 +273,7 @@ namespace OpenTK return; } - if (Configuration.RunningOnMacOS) + if (Configuration.RunningOnMacOS) { DelayUpdate delay = PerformContextUpdate; BeginInvoke(delay); //Need the native window to resize first otherwise our control will be in the wrong place. @@ -480,38 +480,6 @@ namespace OpenTK { get { return implementation.WindowInfo; } } - - #endregion - - #region public Bitmap GrabScreenshot() - - /// - /// Grabs a screenshot of the frontbuffer contents. - /// When using multiple GLControls, ensure that - /// is current before accessing this property. - /// - /// - /// - /// A System.Drawing.Bitmap, containing the contents of the frontbuffer. - /// - /// Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread. - /// - [Obsolete("This method will not work correctly with OpenGL|ES. Please use GL.ReadPixels to capture the contents of the framebuffer (refer to http://www.opentk.com/doc/graphics/save-opengl-rendering-to-disk for more information).")] - public Bitmap GrabScreenshot() - { - ValidateState(); - ValidateContext("GrabScreenshot()"); - - Bitmap bmp = new Bitmap(this.ClientSize.Width, this.ClientSize.Height); - System.Drawing.Imaging.BitmapData data = - bmp.LockBits(this.ClientRectangle, System.Drawing.Imaging.ImageLockMode.WriteOnly, - System.Drawing.Imaging.PixelFormat.Format24bppRgb); - GL.ReadPixels(0, 0, this.ClientSize.Width, this.ClientSize.Height, PixelFormat.Bgr, PixelType.UnsignedByte, - data.Scan0); - bmp.UnlockBits(data); - bmp.RotateFlip(RotateFlipType.RotateNoneFlipY); - return bmp; - } #endregion