Jump to content
  • Advertisement
Sign in to follow this  
hiS_oWn

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

This topic is 3438 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!