Screenshot

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Screenshot

Alexey
Hi :)
I want to make a Screenshot by using class "com.jogamp.opengl.util.awt.Screenshot".
I know there must be some OpenGL context, but i can not find any examples or turtorials about this topic,
so please, can you reccomend me some links with examples or  explain how to use this method correctly.

Sorry, if i'he asked a stupid question, i am a newbie:)
Thanks!
Reply | Threaded
Open this post in threaded view
|

Re: Screenshot

Demoscene Passivist
Administrator
Its actually very simple to get a screenshot of ur JOGL renderings. Here's a small snippet that could be used inside (at the end) of the display() method of ur GLEventListener:

BufferedImage tScreenshot = Screenshot.readToBufferedImage(0,0, tScreenWidth, tScreenHeight, false);
File tScreenCaptureImageFile = new File(tFileName);
ImageIO.write(tScreenshot, "png", tScreenCaptureImageFile);

... or u can press the whole process in a single line
Reply | Threaded
Open this post in threaded view
|

Re: Screenshot

Alexey
Thanks!!!:)
Yeah, It is really to simple:)