Skip to content

Commit

Permalink
2
Browse files Browse the repository at this point in the history
  • Loading branch information
Phillipus committed Oct 15, 2023
1 parent 8488ba6 commit 012a9b5
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 012a9b5

Please sign in to comment.