• Post Reply Bookmark Topic Watch Topic
  • New Topic

Screen Capture  RSS feed

 
rama krishnan
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the problem with screen capturing.

Inside the HTml Page, I calling my JApplet Page.
To capture the Whole screen,I wrote code, below

screencapture = new BufferedImage(this.getWidth(), this.getHeight(), BufferedImage.TYPE_INT_RGB);
Graphics g = screencapture.getGraphics();
g.setColor(this.getBackground());
g.fillRect(0, 0, screencapture.getWidth(), screencapture.getHeight());
this.print(g);
g.dispose();

/*ImageIO.write(screencapture, "JPG", new File("screencapture.jpg")); */

But i can able to capture JApplet area, not with Html area,

Here this.getwidth, this.getHeight refer JApplet

can any give the solution to capture the whole screen
[ December 14, 2008: Message edited by: muthurama krishnan ]
 
Ulf Dittmer
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, "this" refers to the applet itself, and the applet can't access anything outside of its little "sandbox" - that would be a security problem. But if you work around that by signing the applet, or by altering the local security policy, then you can use the Robot class to capture the entire screen.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!