I am attempting to save a jpg image of a plot. The following code is how I thought it should work after doing a bit of research. I have also tried every combination to try and use the correct GL
AWTGLReadBufferUtil readutil = new AWTGLReadBufferUtil (GLProfile.get(GLProfile.GL2GL3),false);
BufferedImage tScreenshot = readutil.readPixelsToBufferedImage(canvas.getGLDrawable().getGL(),true);
File tScreenCaptureImageFile = new File("test.jpg");
try {
ImageIO.write(tScreenshot, "jpg", tScreenCaptureImageFile);
} catch (IOException ex) {
Logger.getLogger(SPDisplay.class.getName()).log(Level.SEVERE, null, ex);
}
All I get is a black image. Any suggestions?