Я пытаюсь нарисовать изображение SWT, но ничего не появляется:
Display display = new Display();
Shell shell = new Shell(display);
shell.open();
Image image = new Image(display, "C:/sample_image.png");
Rectangle bounds = image.getBounds();
GC gc = new GC(image);
gc.drawImage(image, 100, 100);
// gc.drawLine(0, 0, bounds.width, bounds.height);
// gc.drawLine(0, bounds.height, bounds.width, 0);
// gc.dispose();
// image.dispose();
while (!shell.isDisposed()) {
if (!display.readAndDispatch())
display.sleep();
}
display.dispose();
Я проверил, что изображение существует и имеет контент - есть идеи?