mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-01-25 00:51:10 +00:00
Removed obsolete screenshot function.
This commit is contained in:
parent
5f9bf7fea3
commit
094e79a570
|
@ -483,38 +483,6 @@ namespace OpenTK
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region public Bitmap GrabScreenshot()
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Grabs a screenshot of the frontbuffer contents.
|
|
||||||
/// When using multiple <c>GLControl</c>s, ensure that <see cref="Context"/>
|
|
||||||
/// is current before accessing this property.
|
|
||||||
/// <seealso cref="Context"/>
|
|
||||||
/// <seealso cref="MakeCurrent"/>
|
|
||||||
/// </summary>
|
|
||||||
/// <returns>A System.Drawing.Bitmap, containing the contents of the frontbuffer.</returns>
|
|
||||||
/// <exception cref="OpenTK.Graphics.GraphicsContextException">
|
|
||||||
/// Occurs when no OpenTK.Graphics.GraphicsContext is current in the calling thread.
|
|
||||||
/// </exception>
|
|
||||||
[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
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue