2010-05-08

利用 Java 採取畫面圖像 (Use Java to capture the system screen image)

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;

public static BufferedImage getScreenCapture() throws AWTException, IOException {
    return new Robot().createScreenCapture(new Rectangle(Toolkit.getDefaultToolkit().getScreenSize()));
}

沒有留言 :

張貼留言