diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 53bea94809..476afe8b66 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -251,7 +251,10 @@ public class CreateComponentAction extends UpdateAction { private Image componentToImage(Component comp, Rectangle rect) { - BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB); + BufferedImage im = new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); + Graphics2D g2d = (Graphics2D)im.getGraphics(); + g2d.setColor(Color.WHITE); + g2d.fillRect(0, 0 , rect.width, rect.height); comp.paint(im.getGraphics()); return im; } @@ -260,7 +263,7 @@ public class CreateComponentAction extends UpdateAction { private Image moduleToImage(Form form, ElementCaseEditor editor, Map parameterMap, Rectangle rect) { if (editor == null) { - return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_RGB); + return new BufferedImage((int) rect.getWidth(), (int) rect.getHeight(), BufferedImage.TYPE_INT_ARGB); } FormElementCaseProvider provider = editor.getElementCase(); provider.setName(editor.getWidgetName());