PDA

View Full Version : Saving OpenGL Graphics as a JPEG



kal_mans
09-07-2003, 07:57 PM
Hello,
If i have a Layout drawn using OpenGl Commands...the layout may be a Rectangle or anything...
now if i want to save that a JPEG....how can i do that...?
i tried out the GrabWidget option available wid the Designer but doesnt seems to work..
so is there any options available in OpenGL to do this....?
Waiting for ur replies..
Kalpesh.

nukem
09-07-2003, 08:52 PM
ksnapshot will take a screenshot of your OGL app. It works perfectly.

m2
09-07-2003, 08:55 PM
Originally posted by kal_mans:
now if i want to save that a JPEG....how can i do that...?

You mean from your program? render, glFinish(); setup_pixel_transfer(); glReadPixels(...); and then use something in the Qt (I'm guessing "Layout" and "Designer" refer to Qt) API that takes a raw RGB image and saves it to a JPEG.

kal_mans
09-07-2003, 09:39 PM
Hi,
Thanks a lot for the Replies...
i have tried out something like GrabWindow..
that seems to be working...
let me try out ksnapshot...

anywayz thanks a lot nukem and m2..
thanks a lot..
- Kalpesh.