From 68c5e528f42b9007a5179c84e71bf7a0a32689a7 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 15 Sep 2021 11:31:53 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-59450=20=E5=88=9B=E5=BB=BA=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=B0=81=E9=9D=A2=E5=9B=BE=E8=83=8C=E6=99=AF=E6=98=AF?= =?UTF-8?q?=E9=BB=91=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/share/action/CreateComponentAction.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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());