Sign in to follow this  
hiS_oWn

[java] How do you take a picture of your JOGL GLCanvas?

Recommended Posts

Right now I'm using a robot to do a screen capture, but whatever image I get is restricted by my screen resolution. Is there a way to either get a very high resolution image or control the output resolution either through openGL or the JOGL interface?

Share this post


Link to post
Share on other sites
I've never used JOGL before but to take a screen capture using OpenGL you can read the contents of the frame buffer using glReadPixels.

To create an image from this you could do something like create a BufferedImage, set its pixel data to the data read from OpenGL and then use ImageIO to write it. (or you could write your own).

Share this post


Link to post
Share on other sites
just use the Screenshot util, works pretty well.
http://download.java.net/media/jogl/builds/nightly/javadoc_public/com/sun/opengl/util/Screenshot.html

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this