27 lines
751 B
Java
27 lines
751 B
Java
/*
|
|
* To change this license header, choose License Headers in Project Properties.
|
|
* To change this template file, choose Tools | Templates
|
|
* and open the template in the editor.
|
|
*/
|
|
package br.edu.ufsj.sms.control;
|
|
|
|
import java.awt.AWTException;
|
|
import java.awt.Rectangle;
|
|
import java.awt.Robot;
|
|
import java.awt.Toolkit;
|
|
import java.awt.image.BufferedImage;
|
|
import java.io.IOException;
|
|
|
|
/**
|
|
*
|
|
* @author flavio
|
|
*/
|
|
public class ScreenShot {
|
|
|
|
public static BufferedImage takeAShot() throws AWTException, IOException {
|
|
Robot robot = new Robot();
|
|
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
|
|
BufferedImage output = robot.createScreenCapture(screenRect);
|
|
return output;
|
|
}
|
|
} |