Size s = Size;
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);
GL.glReadPixels(0, 0, 1600, 1200, GL.GL_BGRA_EXT,
GL.GL_UNSIGNED_BYTE, bd.Scan0);
b.UnlockBits(bd);
//b.RotateFlip();
b.Save(@"D:\screen.bmp", ImageFormat.Bmp);
Regards,
fadah.
[Edited by - jast112 on April 16, 2008 11:40:33 AM]
Opengl C#
Hey all.
Anyone can tell me why are my screenshots black???? plz help ty
Im using CsGl
Here is the code.
Is there a reason you specified a format for glReadPixels that doesn't match the format of your Bitmap object?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement