I came here from how to capture the image drawn using opentk. First, I don't have access to the object "glControl1" in the example. My main window inherits from OpenTK.Windowing.Desktop.GameWindow. Next, the image I'm getting seems to be really blurry and has repeated images horizontally. Finally, I can't access all the members and fields that the example used so I extracted them differently and I'm not sure if they are the same or not.
Here is my version of "TakeScreenshot()" but I do not have their solution of "GLrefresh()"
public Bitmap TakeScreenshot()
{
if (this.Context == null)
throw new Exception("the \"Context\" was null ");
int w = Size.X;
int h = Size.Y;
Box2i boxFromGameWindow = this.ClientRectangle;
Vector2i bottomCoordinate = boxFromGameWindow.Min;
Vector2i topCoordinate = boxFromGameWindow.Max;
Vector2i sizeOfWindowVector = boxFromGameWindow.Size;
Point topLeftPoint = new Point(bottomCoordinate[0], topCoordinate[1]);
Size sizeOfWindow = new Size(sizeOfWindowVector[0], sizeOfWindowVector[1]);
Rectangle convertedRectangle = new Rectangle(0, 0, sizeOfWindowVector[0], sizeOfWindowVector[1]);
Bitmap bmp = new Bitmap(sizeOfWindowVector[0], sizeOfWindowVector[1]);
System.Drawing.Imaging.BitmapData data =
bmp.LockBits(convertedRectangle, System.Drawing.Imaging.ImageLockMode.WriteOnly, bmp.PixelFormat);
GL.ReadPixels(0, 0, sizeOfWindowVector[0], sizeOfWindowVector[1], PixelFormat.Rgb, PixelType.UnsignedByte, data.Scan0);
bmp.UnlockBits(data);
bmp.RotateFlip(RotateFlipType.RotateNoneFlipY);
return bmp;
}