Screenshot of a GLCanvas

I am implementing code on top of an existing project.
The display shows a GLCanvas. Is there a way to take a screenshot of that code. I have tried to use technique of using finding a rectangle of where the GLCanvas is on the screen and then taking a screenshot of that, but if other windows are overlapping the GLCanvas, they will be included in the screenshot as well.

Try glReadPixels. Matt wrote a rather nice implementation (based on some of my crap code):

http://www.matthiasmann.de/content/view/15/26/

(It’s LWJGL though, but porting it should be pretty straightforward.)

You may first have a look at the Screenshot class of JOGL.
I guess that it is what your looking for.

Jean-Baptiste

Ah right. JOGL does have a class for this. :slight_smile: