Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/354.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用Java频繁截图_Java_Screenshot - Fatal编程技术网

使用Java频繁截图

使用Java频繁截图,java,screenshot,Java,Screenshot,我有这个截图代码;我怎样才能将其更改为每秒拍摄并缓冲一个屏幕截图 { BufferedImage image = robot.createScreenCapture(rectangle); search: for(int x = 0; x < rectangle.getWidth(); x++) { for(int y = 0; y < rectangle.getHeight(); y++) { } }

我有这个截图代码;我怎样才能将其更改为每秒拍摄并缓冲一个屏幕截图

{
    BufferedImage image = robot.createScreenCapture(rectangle);
    search: for(int x = 0; x < rectangle.getWidth(); x++)
    {
        for(int y = 0; y < rectangle.getHeight(); y++)
        {

        }
    }
}
{
BuffereImage image=robot.createScreenCapture(矩形);
搜索:查找(intx=0;x
您可以(除其他外)在JDK中使用,例如:

Timer t = new Timer("Sceenshot timer");
    TimerTask screenShotTask  = new TimerTask() {
        @Override
        public void run() {
            // Call your code
        }
    };
    t.schedule(screenShotTask, 1000);