Snapping OpenGL client to ClipBoard

I’m using the code here:
to capture my openGL scene into a picture file. But when I call the method in my program and then I try pasting into a picture file, I just get a big light grey rectangle pasted into the file. It doesn’t capture the image on my openGL screen. However, the rectangle that gets pasted is always the same size as my openGL scene, it just doesn’t draw the scene. Anybody know what could be wrong and how i could fix this?

[This message has been edited by Rajveer (edited 04-08-2002).]

Looks like a pixel-format problem. The pixel format should be the same on both sides (your rendering context and your file). For example if you’re rendering in 24-bit rgb, then you should export to a 24-bit rgb file. If it’s not, make sure you’ve done the conversion properly.

Already accounted that, it said on the site that the code I’m using is for screen configurations set to true color. I checked my settings and it was set to 24 bit true color. As far as exporting to a file, I’m trying to paste it into MSPaint. I’m not sure how to check if the file is 24-bit rgb. Couldn’t find anything in the program help, but I don’t think this is the problem. Anyone know what else might be wrong?

Here is a working version with source code by the same author Pierre Alliez.

That should fix your problems

Also note that you can simply press Alt-PrintScreen to capture the contents of any window - including OpenGL windows - into the clipboard. Works just fine for me