Windows Toolbar Icons: PNG transparency

2016r3
I an working on an app that needs to run on both Mac (retina and not) and Windows and it uses a toolbar with toll buttons with Icons. I an using PNG Icons with alpha channels. It looks great on the Mac the but on Windows the transparent parts show up as black even with UseGDIPlus on… Obviously not good…

How do I deal with this?

In the past I would have used Icons with white backgrounds and after dragging the file into the IDE I would have set white to be transparent in the inspector and see if that worked, but I can’t do that with Image sets as far as I can see.

Thanks,

  • Karen

I just tried this here and it appears to be working just fine as far as I can tell on Windows 10. Can you give us more information about what version of Windows you are using and are you building on your Mac or directly within Windows?

How about you try my sample on your machine…

https://www.dropbox.com/s/a434pd3k5iobxrd/RetinaToolbarTest.zip?dl=1

No difference building on a Mac (10.9.5) or on Windows 7 (on Parallels).

Windows 7:

Mac:

  • Karen

[quote=294251:@Greg O’Lone]How about you try my sample on your machine…

https://www.dropbox.com/s/a434pd3k5iobxrd/RetinaToolbarTest.zip?dl=1[/quote]

Yours looks OK.

I have no idea what is going on.

  • karen

I use the Fatcow icons, which have transparent background, throughout Check Writer Windows toolbar, and have never seen what you describe. It could come from the picture files you are using.

Hi Michel,

All I know is that they are PNG icons I got with an Omegabundle, and they work fine in a Mac. (I updated my post above for the correct link for how they appear on a Mac)

  • karen

Could you try at least one of the fatcows ones, just to see if the issue persists ? It could shed some light on the problem.

I did, and I get the same thing (Transparent Area is Black) on Windows.

  • karen

Doh !

2015r1 here, not yet tested on WIndows 10 (or XP). I fear to fall into the same trouble.

a. my icons are less nice than Karen’s,
b. I removed the white around the colored parts (using GIMP).

I will get an eye on WIndows 10 (and XP) later when I will have a free USB Port available to move the application there.

I edited my last sentence above because I had troubles to wrote it correctly. Sorry!

OK: I just checked. My files with alpha channel (no surrounding white) are displayed correctly under Windows 10.

The only drawback is the filler Icon (the 32 x 32 icon is 653 bytes, nomask, png: copy from GIMP, Paste into Preview and save to disk as png) who holds nothing (not a single pixel !): it appears black.

I will add a discontinued vertical black line in the horizontal middle of the icon and this will be OK (or I will have to completely remove them if I need room for the other Icon I will have to add).

Karen: are your icons OK now (on Windows) ?

Linux user: can you told us the situation on Linux (Mint ?)

Edit:

I downloaded Greg project (and, sight, I cannot test it now *) and I check its icons / png files: these looks like mine: no white surrounding the circles.
(I do not set @x3 files)

I really have to find an USB hub.

[quote=294275:@Emile Schwarz]Karen: are your icons OK now (on Windows) ?

[/quote]

No… but it might be a Parallels thing.

I used a real PC laptop with a genuine Windows 10. I also have a boot HD with VirtualBox, and WIndows XP but… (read below).

BTW: use Greg images just for a test as you know his project works… or rename some of your icons and put them in Greg project !

I have only two USB (standard, not USB 3) ports on each of the two laptops: I have to think twice before doing something; it is easy to have both of them on use. Actually, I have an Elgato Diversity DVB (TNT) key on one and the TV target Hard Disk (to record a movie in some minutes) on the second: I cannot move anything to the PC laptop 'till the recording is done :frowning:
I take an SD-Card at Kaufland, but the locked is lost: I cannot write to it from the MacBook Pro :frowning:
(I used that to workaround the # of available USB ports :frowning: ).

Karen, do you have a sample project to share? It might be helpful for us to see what the IDE is doing to your pngs. Perhaps some setting is causing some kind of issue because Greg’s project worked for you.

But you ran mine in the same environment, so it’s probably not that. I suspect there’s something up with the pngs, but until I see them, I can’t tell…

Could you email them to me?

Hm. So I just imported your icons into three Image objects in a sample project and ran on both Windows 10 and Windows 7 and I still don’t see the results you are getting.

There is something odd about these files though… they’ve got extra metadata in them, including an extra hidden layer of info. I am sending them back to you with that info stripped to see if it fixes the problem on your end.

@Karen: open them in GraphicConverter, save web ready (which should strip extra info) and unselect any other metadata info

[quote=294334:@Greg O’Lone]Hm. So I just imported your icons into three Image objects in a sample project and ran on both Windows 10 and Windows 7 and I still don’t see the results you are getting.

There is something odd about these files though… they’ve got extra metadata in them, including an extra hidden layer of info. I am sending them back to you with that info stripped to see if it fixes the problem on your end.[/quote]

I still see the issue. I’m going to try the app on a real PC later today.

  • Karen

I’l give it try this evening when I get home from work.

  • Karen

Karen, you may want to start a new test project. Could be a project corruption issue.