Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 6 of 6

Thread: taking screenshots

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2004
    Posts
    5

    taking screenshots

    hi all

    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.

    thanks for reading

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: taking screenshots

    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".

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2004
    Posts
    5

    Re: taking screenshots

    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:
    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".

  4. #4
    Intern Contributor
    Join Date
    Mar 2004
    Posts
    62

    Re: taking screenshots

    Check out glReadPixels().

  5. #5
    Advanced Member Frequent Contributor
    Join Date
    Apr 2003
    Posts
    680

    Re: taking screenshots

    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().

  6. #6
    Junior Member Newbie
    Join Date
    Mar 2004
    Posts
    5

    Re: taking screenshots

    checked it out, read the documentation but not really understanding it, this is my first major work with opengl.

    are there any working java examples using readPixels i could check out? searched yahoo and google but didn't find a lot

    cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •