Browse Source

REPORT-59450 创建组件封面图背景是黑的

fix-lag
kuangshuai 3 years ago
parent
commit
68c5e528f4
  1. 7
      designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java

7
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) { 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()); comp.paint(im.getGraphics());
return im; return im;
} }
@ -260,7 +263,7 @@ public class CreateComponentAction extends UpdateAction {
private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) { private Image moduleToImage(Form form, ElementCaseEditor editor, Map<String, Object> parameterMap, Rectangle rect) {
if (editor == null) { 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(); FormElementCaseProvider provider = editor.getElementCase();
provider.setName(editor.getWidgetName()); provider.setName(editor.getWidgetName());

Loading…
Cancel
Save