can anyone tell me how to take screenshots of the contents of a JGLCanvas after some simple spheres and stuff have been drawn on it? I am creating the canvas in a Frame which also has the capture button which does the actionPerformed stuff. i just need to know how to actually get the pixel content and dump it in a .bmp or .jpg.
on windows, push the “print” (in german “Druck”) button, this will copy the framebuffer content to the clipboard, and paste this in paint or word. Alternatively, there’s a program called “wingrab” which does this a little more comfortable.
nah you misunderstand, i’m developing the a molecule visualisation tool in java. i am using the java’s OpenGl libraries to draw the 3d stuff. i would like to include a screenshot feature which takes what ever is drawn on the screen and save it as a bmp of jpeg.
i mite be in the wrong place??
Originally posted by JanHH:
[b]on windows, push the “print” (in german “Druck”) button, this will copy the framebuffer content to the clipboard, and paste this in paint or word. Alternatively, there’s a program called “wingrab” which does this a little more comfortable.
in linux, there’s a program called “ksnapshot”.[/b]
does it matter if the screenshot-button is in your program or in another window next to that? But if you want to save the OpenGL window to a file indeed you have to read it back with glReadPixels().