0

I've got some png icons with lots of transparent pixels, which I want to add to tray. I used NotifyIcon, and I had to convert my .pngs to .ico format.

Here you can see two icons with numbers. Left one is added with C# as a .ico, right one -- with Java as a .png. C# icon looks very blurry.

I also tried to load png, convert it to bitmap and then to icon. But this way I've lost all the transparency.

Bitmap b=(Bitmap)Image.FromFile("res\\b" + percentageCurrent + ".png");
IntPtr pIcon=b.GetHicon();
Icon ico=Icon.FromHandle(pIcon);

Is there a way to use png directly, like in Java, or at least make not-blurred icon from it?

UPD: Checked my ico files -- they seem to be fine and look exactly like pngs. So I assume icons are getting blurred while added to tray.

gn Fur
  • 1
  • 1
  • https://stackoverflow.com/questions/3531232/what-is-the-size-of-the-icons-in-the-system-tray – Hans Passant Jul 16 '17 at 15:18
  • @Hans my icons are 16x16. Now I've tried to create 32x32 icon which I've upscaled myself without blurring - it worked and now icon looks like its Java bro. I assume, there was blurred 32x32 version, which was created automatically. – gn Fur Jul 16 '17 at 15:33

0 Answers0