我正在尝试使用打印屏幕图像区域来获取 2 台显示器,但仅适用于一台显示器。你能告诉我如何获得数字 2 显示器吗?
Robot robot = new Robot();
Rectangle screenRect = new Rectangle(Toolkit.getDefaultToolkit().getScreenSize());
BufferedImage capture = new Robot().createScreenCapture(screenRect);
ImageIO.write(capture, "bmp", new File("printscreen.bmp"));