V
Vin
Hi,
I save the drwan stuff on a GLView using CsGL like this:
Size s = Size;
s.Width = 540;
s.Height = 435;
Bitmap b = new Bitmap(s.Width, s.Height,
PixelFormat.Format32bppArgb);
BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width,
s.Height),ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
CsGL.OpenGL.GL.glReadPixels(0, 0, s.Width, s.Height,
CsGL.OpenGL.GL.GL_BGRA_EXT, CsGL.OpenGL.GL.GL_UNSIGNED_BYTE,
bd.Scan0);
b.UnlockBits(bd);
b.RotateFlip(RotateFlipType.Rotate180FlipX);
b.Save(@"c:\test.bmp", ImageFormat.Bmp);
Now I want to load the same test.bmp on click of a load button.
Can someone share a code snippet for the same. I guess we could use
glDrawPixels. But i m not sure how.
Help is much appreciated.
Cheers
Vin
I save the drwan stuff on a GLView using CsGL like this:
Size s = Size;
s.Width = 540;
s.Height = 435;
Bitmap b = new Bitmap(s.Width, s.Height,
PixelFormat.Format32bppArgb);
BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width,
s.Height),ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
CsGL.OpenGL.GL.glReadPixels(0, 0, s.Width, s.Height,
CsGL.OpenGL.GL.GL_BGRA_EXT, CsGL.OpenGL.GL.GL_UNSIGNED_BYTE,
bd.Scan0);
b.UnlockBits(bd);
b.RotateFlip(RotateFlipType.Rotate180FlipX);
b.Save(@"c:\test.bmp", ImageFormat.Bmp);
Now I want to load the same test.bmp on click of a load button.
Can someone share a code snippet for the same. I guess we could use
glDrawPixels. But i m not sure how.
Help is much appreciated.
Cheers
Vin