tags:

views:

56

answers:

1

No. Not pressing PRT Screen. But here is what I want. And I need to know if it can be done and by what means :D

Okay so I have a java applet that runs and displays a walking man. I need it so when I access a script (in some web scripting language) it takes a "screenshot" of that applet and then saves it on the server. Is this possible? and by what scripting means could I do it?

Thanks in advance!

+2  A: 

If there are heavyweight components they might not come out, but the obvious way is:

  • Create a java.awt.image.BufferedImage
  • Call createGraphics to create a Graphics instance.
  • Call update(Graphics) on the applet.
  • Find a tutorial for converting the BufferedImage to a wire file format.
  • POST back to the web server.

You can use LiveConnect to connect both ways between Java and JavaScript. It's usually easy to add Java code to an applet simply by adding another reference to the archive attribute of the applet tag.

There are plenty of tutorials on the various parts. I've never done it myself.

Tom Hawtin - tackline