| Site Map | WizTools.org | jCraze Blog |
![]() |
Java Screen CaptureJ2SDK1.4 or above needed for running this code. Captures the Desktop and saves it in PNG format image.
import java.awt.*;
import java.awt.image.*;
import java.io.*;
====================
try{
Toolkit tk = Toolkit.getDefaultToolkit();
tk.sync();
Rectangle ecran = new Rectangle(tk.getScreenSize());
Robot robot = new Robot();
robot.setAutoDelay(0);
robot.setAutoWaitForIdle(false);
BufferedImage image = robot.createScreenCapture(ecran);
//You get a BufferedImage in TYPE_INT_BGR.
File file = new File("CapImageIO.png");
javax.imageio.ImageIO.write(image, "PNG", file);
}
catch(Exception e){
System.out.println(e);
}
|
Sign Guestbook
|
Who is Subhash?
The contents of this site are copyright© 2000-2008, indiWiz.com. All Rights Reserved.