自Windows 10 Update 1809和gc.print()/ gc.copyArea(]起具有SWT的所有黑色像素>

问题描述 投票:1回答:1

我有这段代码在过去的4年中一直有效(对氧气不敏感),>

由于Windows 10 1809更新,这将导致全黑图片。这会在多台PC上发生。

public static Image renderToImage(Control control) {
    Shell imgShell = new Shell(control.getDisplay(), SWT.NO_TRIM);
    Composite oldParent = control.getParent();
    Point size = control.getSize();
    imgShell.setSize(size);
    control.setParent(imgShell);
    Image image = new Image(control.getShell().getDisplay(), size.x, size.y);
    GC gc = new GC(image);

    //gc.setForeground(imgShell.getDisplay().getSystemColor(SWT.COLOR_RED));
    //gc.drawString("Image",size.x/2, size.y/2, true);
    control.print(gc);
    gc.dispose();
    control.setParent(oldParent);

    return image;
  }

我将我的应用程序从氧气更新为eclipse-rcp-1903,此问题仍然存在。

gc.drawString行有效,并将单词“ Image”写入图像。

以下屏幕截图显示了问题。黑色区域应该是从外壳复制而来的图像,该外壳看起来像是下面的外壳。enter image description here

我有这段代码在过去的4年中一直工作(对氧气不敏感),因为Windows 10 1809更新了此代码后,结果变成了全黑。这会在多台PC上发生。 ...

eclipse windows-10 swt eclipse-rcp eclipse-2019-03
1个回答
0
投票

我有同样的问题,您设法找到任何解决方案了吗?谢谢

© www.soinside.com 2019 - 2024. All rights reserved.