Sign in to follow this  
Pirosan

[java] Java and LWJGL - saving screenshots

Recommended Posts

Pirosan    124
I have a question regarding the LWJGL libraries in java. I want to save the current rendered screen to a jpg... Is this easy to do with java? Also, along the same lines, I want to edit a texture loaded for opengl directly through java, it may not be fast, but is it possible? Cheers

Share this post


Link to post
Share on other sites
Guest Anonymous Poster   
Guest Anonymous Poster
http://phpfi.com/112963

That one doesnt use ImageIO and is ultra fast. Saves as TGA tho. Using BGR directy would require opengl 1.2... therefore I went with rgb and that moving around loop.

If you really want to use jpg. Create some (buffered) image in the desired size, then use setRGB (with array parameter) or setRaster for drawing the data over and ImageIO.write it at the end. Thats it.

You can also try searching for screenshot over at the javagaming.org and lwjgl.org forums. There were several threads about this topic in the past.

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