Login  Register

Screenshot

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

Screenshot

Alexey
2 posts
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
| More
Print post
Permalink

Re: Screenshot

Demoscene Passivist
Administrator
214 posts
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
| More
Print post
Permalink

Re: Screenshot

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