开发者

Screen capture of a java applet

开发者 https://www.devze.com 2023-01-09 02:27 出处:网络
I\'d like to \"capture\" a screenshot of what a java applet would currently look like if it were loaded, effectively screenshoting an applet without the use of a vdu.

I'd like to "capture" a screenshot of what a java applet would currently look like if it were loaded, effectively screenshoting an applet without the use of a vdu.

The purpose of this is to display the ima开发者_C百科ge to a user that doesn't have a JVM. Lets assume the applet is a digital clock and has no requirement on user input. So what could be done is set up a pc connected to a vdu, open the applet, schedule a script to take a screenshot and upload the image. Clients could then access what the applet would look like at any given time without the requirement on a jvm.

It'd be such a hassle to have a pc running all the time etc. Surely this could be done somehow without a display.

Would it be possible to create a virtual display in a jvm that can render an applet and then take a screen capture?

If this were possible then perhaps a really high resolution display could be virtualized to create a very high resolution screenshot.


The ScreenImage class should handle this.


Look at java.awt.Robot#createScreenCapture(java.awt.Rectangle)


If this would work, i would wonder, remind the sandbox, and as the above link stated "This will work whether you have an AWT or Swing application."


If you use a "rendering-engine" (composing each pixel to something paintable before repaint()'ing) within you applet, you could use this information and create an image.

0

精彩评论

暂无评论...
验证码 换一张
取 消