Login  Register

Re: Screenshot

Posted by Demoscene Passivist on Feb 21, 2011; 8:59pm
URL: https://forum.jogamp.org/Screenshot-tp2547962p2548075.html

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