473,321 Members | 1,622 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,321 software developers and data experts.

CSGL Save OpenGL Frame as picture

Hello,

I saw a problem about that. And I tried below code to do it. But all of informations are gotten as 0. I could not save frame as Picture. Could you help me? I use C# CSGL.

Expand|Select|Wrap|Line Numbers
  1. public void saveScene()
  2. {
  3. Size s = Size;
  4.  
  5. Bitmap b = new Bitmap(s.Width, s.Height,
  6. PixelFormat.Format32bppArgb);
  7. BitmapData bd = b.LockBits(new Rectangle(0, 0, s.Width, s.Height),
  8. ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb);
  9. GL.glReadPixels(0, 0, s.Width, s.Height, GL.GL_BGRA_EXT,
  10. GL.GL_UNSIGNED_BYTE, bd.Scan0);
  11. b.UnlockBits(bd);
  12. //b.RotateFlip();
  13. b.Save(@"c:\test.bmp", ImageFormat.Bmp);
  14. }
  15.  
May 16 '13 #1
0 1282

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: daimler | last post by:
help!!!!!!!! i did a for i=1 to picture1.scaleheight/2 picture1.pset (i,i) next i and the pset is shown on the picture
2
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my...
2
by: Michael Lehar | last post by:
Hallo I have a pictureBox with a picture loaded from file, then I draw some lines on the picture, and then I want to save the new picture. Befor I can draw lines I have to create a Graphics...
3
by: Vin | last post by:
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...
3
by: Lespaul36 | last post by:
I have a picturebox that holds other pictureboxes. I want to set up an Undo routine for the project. Is there a way to save the parnt picture box. Or what is a good way to go about doing this....
1
by: liuliuliu | last post by:
hi -- sorry if this is trivial -- but how do you make a screenshot of a pygame display? i have a surface which is basically the entire visible screen -- how do you write this surface as an image...
3
by: raghunadhs | last post by:
hi all! i have a picture box, in that picture box, there is a picture asume it as "pic1.bmp".. now i have made some changes in that picture. Now i want to load a picture to a image( my form...
2
by: kimiraikkonen | last post by:
Hello, I want to save a picture using that code and i have a read-only textbox on the picturebox1 named "textbox2". I want users to enter their custom text using "textbox1" and save the image...
0
by: swathiRasamallu | last post by:
I am using CsGL in C#.Net for graphical display.I want to rotate 2D triangle continuously.But i dont know how to do that in CsGL.In OpenGL we use glutidlefunction() for animations.What about CsGL?
1
by: anuraag1070 | last post by:
Hey can anyone help me in, for getting the save dialog box when we want to save a frame thank you for helping me out, anuraag
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.