How to print an OpenGL screen?

Started by
2 comments, last by Ilici 19 years, 5 months ago
Hi ALL, Does anyone know how to print an OpenGL screen? Delphi code will be welcome.
Advertisement
You haven't given much information. Do you mean print from a printer, or copy to memory, like the Print Screen key? Are you using Win32, or some other platform?

I'll assume you mean print from a printer, and you're using Win32. You need to get the colour data from the OpenGL frame buffer (use glReadPixels), then use the Win32 Printing and Print Spooler functions...
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]
Assumming you want to print the exciting snap shot that's currently on your screen - press Print Screen key on your keyboard - start up Microsoft Paint - then paste it in (ctrl-v)

cheers
IIRC First of all use glReadBuffer to copy the screen buffer pixels into a memory buffer. Secondly, blit this buffer to a TPicture object's canvas (i think you can use putpixel). Get the TPrinter object and start printing (i think it is the Begin procedure). Blit from the picture with the opengl buffer to the TPrinter canvas and then end the print. Make sure you scale the image to fit into the paper.

This topic is closed to new replies.

Advertisement