Browse Source

Pull request #5856: REPORT-59450 创建组件封面图背景是黑的

Merge in DESIGN/design from ~TOMMY/design:final/11.0 to final/11.0

* commit '68c5e528f42b9007a5179c84e71bf7a0a32689a7':
  REPORT-59450 创建组件封面图背景是黑的
persist/11.0
Tommy 3 years ago
parent
commit
e1ba6222bb
  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) {
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<String, Object> 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());

Loading…
Cancel
Save