diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java index 155ac4168b..d8816c3e3f 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorPicker.java @@ -167,17 +167,18 @@ class ColorPickerPanel extends JPanel * 截屏 */ public void captureScreen() { - try - { + try { robot = new Robot(); } - catch (AWTException e) - { + catch (AWTException e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); } // 截屏幕 - screenImage = robot.createScreenCapture(new Rectangle(0, 0, Toolkit - .getDefaultToolkit().getScreenSize().width, Toolkit - .getDefaultToolkit().getScreenSize().height)); + Rectangle rectangle = new Rectangle(0, 0, 0, 0); + for (GraphicsDevice gd : GraphicsEnvironment.getLocalGraphicsEnvironment().getScreenDevices()) { + rectangle = rectangle.union(gd.getDefaultConfiguration().getBounds()); + } + screenImage = robot.createScreenCapture(rectangle); } /**