PDA

View Full Version : printing the screen



prakash
05-29-2002, 04:10 AM
How to print the screen that we created in OpenGL?Is there any direct command for that?
for giving it to printer

Pat
05-29-2002, 04:20 AM
There is no direct command.

I believe the method that I've used is typical. You'll have to create an "in-memory" rendering context that is of a resolution that matches your printer resolution (or close). Render to the new RC. Capture the pixel data and print it. I set a limit to the resolution of the in-memory RC because the resolution of most modern printers is much higher than the screen resolution and the in-memory image could get really large.

I have seen sample code on the web for doing this in C++, but I can't recall the link.

Good luck.
Pat

Rajveer
05-29-2002, 11:41 AM
Also, you can capture any window by pressing Alt+PrintScrn and then pasting it into a bitmap. Then you can edit the picture to remove stuff you don't want, i.e. menus and things that are present if you're rendering openGL with an SDI or MDI


Originally posted by prakash:
How to print the screen that we created in OpenGL?Is there any direct command for that?
for giving it to printer