Is there an easy way to grab something rendered in a glControl and store it in a Bitmap or Image object?
This is the code I'm using now:
Bitmap^ thumb = gcnew Bitmap(glControl->Width,glControl->Height); Graphics^ gr = Graphics::FromImage(thumb); gr->Clear(Color::White); array<int>^ pixels = gcnew array<int>(3*thumb->Width*thumb->Height); GL::ReadPixel(0, 0, glControl->Width,glControl->Height, PixelFormat::Rgb, PixelType::Int, pixels); for(int y = 0; y < thumb->Height; y++) for(int x = 0; x < thumb->Width; x++) thumb->SetPixel(x,thumb->Height-y-1,Color::FromArgb(pixels[((thumb->Width*y )+ x)*3]));
I know the color interpretation is completely wrong, but before I fix that I'm wondering why I'm not getting the entire image. It grabs everything from the far left, to about 3/4 of the way to the right and cuts off there....
...This code is a mess because I've been trying different stuff all day, but it at least gives you an idea of where I'm at.