From 012a9b5c0a6f1ccbfeffe550f0327c309a8b8df3 Mon Sep 17 00:00:00 2001
From: Phillipus
Date: Sun, 15 Oct 2023 16:25:36 +0100
Subject: [PATCH] 2
---
.../com/archimatetool/editor/SplashHandler.java | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/com.archimatetool.editor/src/com/archimatetool/editor/SplashHandler.java b/com.archimatetool.editor/src/com/archimatetool/editor/SplashHandler.java
index 8460116a5..61023e49a 100644
--- a/com.archimatetool.editor/src/com/archimatetool/editor/SplashHandler.java
+++ b/com.archimatetool.editor/src/com/archimatetool/editor/SplashHandler.java
@@ -78,16 +78,20 @@ private void checkMacImageInverted(Shell shell) {
* From https://github.com/knime/knime-product/commit/095c88e22ba6d84e22a480f50734141836098169
*/
private boolean isImageFlipped(Display display) {
- PaletteData palette = new PaletteData(new RGB(255, 255, 255), new RGB(0, 0, 0));
- ImageData imageData = new ImageData(1, 2, 1, palette);
- imageData.setPixel(0, 1, 1);
- Image image = new Image(display, imageData);
+ Image image = new Image(display, 1, 2);
+
+ GC gc = new GC(image);
+ gc.setForeground(new Color(null, 0, 0, 0));
+ gc.drawPoint(0, 1);
+ gc.dispose();
+
+ ImageData imageData = image.getImageData();
System.out.println(imageData.getPixel(0, 1));
Shell control = new Shell(SWT.NONE);
control.setBackgroundImage(image);
-
+
ImageData backgroundData = control.getBackgroundImage().getImageData();
int top = backgroundData.getPixel(0, 1);
control.dispose();