You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
GC#drawIcon draws *.ico(for some icons) with black background on Windows 10 #185
Describe the bug
Please run the attached snippet on Windows 10 (default Windows mode: Dark, default app mode: light). It will get the icons for certain file types and render them. For some reason, the background of the images is rendered in black. ProgramImageTest.java.txt
To Reproduce
See above.
Expected behavior
The background should be transparent.
Screenshots
Environment:
Windows 10, Version 21H1 (OS Build 19043.1706)
This is reproducible with the latest SWT built from source (v4952r11). With bisecting I've found out that commit 22797d3Revert "Revert "Bug 493455 - [win32] remove alpha and alphaData from Image"" introduced this bug.
This is reproducible with the latest SWT built from source (v4952r11). With bisecting I've found out that commit 22797d3Revert "Revert "Bug 493455 - [win32] remove alpha and alphaData from Image"" introduced this bug.
I don't have those program icons on my system, so when I run the snippet the program icons I have render OK. @tmssngr Can we get an actual icon to test with? Also, is this Hi DPI?
I don't have those program icons on my system, so when I run the snippet the program icons I have render OK. @tmssngr Can we get an actual icon to test with? Also, is this Hi DPI?
Please share a screen grab on how the icon looks for you.
changed the title [-]Program.getImageData returns images with black background on Windows 10[/-][+][HiDPI] Program.getImageData returns images with black background on Windows 10[/+]on Jun 1, 2022
This is reproducible with the latest SWT built from source (v4952r11). With bisecting I've found out that commit 22797d3Revert "Revert "Bug 493455 - [win32] remove alpha and alphaData from Image"" introduced this bug.
@tmssngr Do you think if we reverted this, it would solve the regression?
I've tried reverting e891658, 819a24e, def5c63 and 22797d3, but then it did not compile any more because of a missing hDC in Image. Because I'm not an expert in the internals, I've aborted my tests.
@niraj-modi Hi Niraj, thanks for taking a look at this. I tested your patch with the example case in #185 (comment) and I can confirm it seems to fix the problem.
Activity
iloveeclipse commentedon Jun 1, 2022
@tmssngr :
tmssngr commentedon Jun 1, 2022
This is reproducible with the latest SWT built from source (v4952r11). With bisecting I've found out that commit 22797d3 Revert "Revert "Bug 493455 - [win32] remove alpha and alphaData from Image"" introduced this bug.
niraj-modi commentedon Jun 1, 2022
@jonathan.meier@outlook.com
Please have a look.
niraj-modi commentedon Jun 1, 2022
I don't see this problem happening in Eclipse.
@SyntevoAlex @Phillipus
Do you see this problem in any of you Eclipse based applications ?
We are just trying to understand how severe is this problem.
Phillipus commentedon Jun 1, 2022
I don't have those program icons on my system, so when I run the snippet the program icons I have render OK. @tmssngr Can we get an actual icon to test with? Also, is this Hi DPI?
niraj-modi commentedon Jun 1, 2022
Please share a screen grab on how the icon looks for you.
Phillipus commentedon Jun 1, 2022
Phillipus commentedon Jun 1, 2022
Found it.
I had to set Windows custom scaling to 200 or run the snippet with the argument
-Dswt.autoScale=200[-]Program.getImageData returns images with black background on Windows 10[/-][+][HiDPI] Program.getImageData returns images with black background on Windows 10[/+]niraj-modi commentedon Jun 1, 2022
Eclipse at HiDPI is working fine for External Program Icons:

So problem seems specific to this test-snippet only.
Phillipus commentedon Jun 1, 2022
It seems to be only some Program icons that have this problem.
Try running this modified snippet:
Modified Snippet
Phillipus commentedon Jun 1, 2022
Strange, now I am able to reproduce this with scaling at 100%:
niraj-modi commentedon Jun 1, 2022
Interestingly problem is seen only with second run onward irrespective of zoom.

Even got it working with 200% as well:
Revised steps to reproduce the issue with test-snippet:
14 remaining items
Phillipus commentedon Jun 16, 2022
@jonathan-meier Hi, did you find some time to implement a PR? Happy to test it if required. 👍
tmssngr commentedon Jul 1, 2022
@jonathan-meier Unfortunately, your
maskColormethod doesn't resolve the problem for me (Windows 10).Phillipus commentedon Jul 5, 2022
@tmssngr Do you think if we reverted this, it would solve the regression?
tmssngr commentedon Jul 5, 2022
I've tried reverting e891658, 819a24e, def5c63 and 22797d3, but then it did not compile any more because of a missing
hDCinImage. Because I'm not an expert in the internals, I've aborted my tests.tmssngr commentedon Jul 7, 2022
I really would appreciate it if this obvious regression could be fixed soon.
Phillipus commentedon Jul 7, 2022
@jonathan-meier Hi Jonathan, do you think it is possible to fix this regression?
niraj-modi commentedon Jul 7, 2022
Based on above input, I have a working fix for this issue:
GC#drawIcon draws *.ico(for some icons) with black background on
Phillipus commentedon Jul 7, 2022
@niraj-modi Hi Niraj, thanks for taking a look at this. I tested your patch with the example case in #185 (comment) and I can confirm it seems to fix the problem.
GC#drawIcon draws *.ico(for some icons) with black background on
tmssngr commentedon Jul 11, 2022
Thanks for the fix.