private void writeResult( GL gl ) { ByteBuffer buffer = imageBuffer.getBuffer(); int limit = buffer.limit(); buffer.limit( width * height * 3 ); resultImage = getFrameBufferRGB( gl, buffer, 0, 0, width, height, null ); buffer.limit( limit ); }
private void writeResult( GL gl ) { int width = params.getScreenPixelsX(); int height = params.getScreenPixelsY(); BufferedImage resultImage = JOGLUtils.getFrameBufferRGB( gl, null, 0, 0, width, height, null ); try { File f = File.createTempFile( "wpvs_", ".jpg" ); ImageIO.write( resultImage, "jpg", f ); System.out.println( "Wrote file to: " + f.getAbsolutePath() ); } catch ( IOException e ) { // nottin } }
imageBuffer = getFrameBufferRGB( glContext, imageBuffer, viewPortX, viewPortY, width, height ); if ( resultImage == null || resultImage.getWidth() < width || resultImage.getHeight() < height ) { resultImage = new BufferedImage( width, height, BufferedImage.TYPE_3BYTE_BGR );