Closed
Description
Describe the bug
Background images on SWT controls are inverted.
This was reported here but I've opened a dedicated issue as it's not to do with the splash screen but rather Control#setBackgroundImage
.
To Reproduce
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.layout.FillLayout;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
public class ImageTest {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
shell.setText("Image Test");
shell.setLayout(new FillLayout());
Image image = new Image(display, ImageTest.class.getResourceAsStream("splash.png"));
shell.setBackgroundImage(image);
shell.setSize(image.getBounds().width, image.getBounds().height);
shell.open();
while(!shell.isDisposed()) {
if(!display.readAndDispatch()) display.sleep();
}
display.dispose();
}
}
Use this image for testing (rename to splash.png), or your own image if you prefer:
Expected behavior
The image should display the right way.
Screenshots
Run the snippet and see this:

Environment:
- Select the platform(s) on which the behavior is seen:
-
- All OS
-
- Windows
-
- Linux
-
- macOS
-
Additional OS info (e.g. OS version, Linux Desktop, etc)
macOS Sonoma 14
Mac Mini M1 -
JRE/JDK version
Temurin 17