import java.awt.Rectangle;
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import org.apache.log4j.Logger;
import com.mt.classification.InterfaceAudience;
import com.mt.classification.InterfaceStability;
/**
* TODO Description go here.
*
* @author Varra
* @version 1.0
*
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class Screen2Image
{
/** The logger to log the debugging messages as application runs. */
private static final Logger logger = Logger.getLogger(Screen2Image.class);
public static void main(String[] args) throws Exception
{
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(screenShot, "JPG", new File("screenShot.jpg"));
}
}
import java.awt.Robot;
import java.awt.Toolkit;
import java.awt.image.BufferedImage;
import java.io.File;
import javax.imageio.ImageIO;
import org.apache.log4j.Logger;
import com.mt.classification.InterfaceAudience;
import com.mt.classification.InterfaceStability;
/**
* TODO Description go here.
*
* @author Varra
* @version 1.0
*
*/
@InterfaceAudience.Public
@InterfaceStability.Evolving
public class Screen2Image
{
/** The logger to log the debugging messages as application runs. */
private static final Logger logger = Logger.getLogger(Screen2Image.class);
public static void main(String[] args) throws Exception
{
Robot robot = new Robot();
BufferedImage screenShot = robot.createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
ImageIO.write(screenShot, "JPG", new File("screenShot.jpg"));
}
}
No comments:
Post a Comment