zl程序教程

您现在的位置是:首页 >  其它

当前栏目

e864. 取的显示器大小尺寸

大小 尺寸 显示器
2023-09-14 09:11:59 时间

See also e670 缓冲图像转换为图像.

    try {
        Robot robot = new Robot();
    
        // Capture a particular area on the screen
        int x = 100;
        int y = 100;
        int width = 200;
        int height = 200;
        Rectangle area = new Rectangle(x, y, width, height);
        BufferedImage bufferedImage = robot.createScreenCapture(area);
    
        // Capture the whole screen
        area = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
        bufferedImage = robot.createScreenCapture(area);
    } catch (AWTException e) {
    }

 

Related Examples