java print screen two monitors
问题 I'm trying to use print screen image area to get 2 monitors, but only works for one monitor. Can you advise me how to get figure 2 monitors? 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")); 回答1: Union together the bounds of each screen: Rectangle screenRect = new Rectangle(0, 0, 0, 0); for (GraphicsDevice