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
Union together the bounds of each screen:
Rectangle screenRect = new Rectangle(0, 0, 0, 0);
for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) {
screenRect = screenRect.union(gd.getDefaultConfiguration().getBounds());
}
BufferedImage capture = new Robot().createScreenCapture(screenRect);