PNG TrayIcon transparency on Windows

会有一股神秘感。 提交于 2019-12-06 00:32:20

问题


I'm trying to use a transparent PNG as the icon for my Java application. The image on the JFrame and task bar work great. However, when I use the image with a TrayIcon, I get a black matte background around the edge of the PNG.

Has anybody else come across this issue? I would really like to use a PNG instead of GIF or JPEG.


回答1:


With Java6, a PNG picture should be used for TrayIcon, but as mentioned in this SO question, check:

  • the background color chosen to represent the transparent pixels
  • the transparency options
  • the resolution of the icon
  • alternate format like SVG (provided you are using external library like Batik, and conversion mechnism to java.awt.Image)


来源:https://stackoverflow.com/questions/387768/png-trayicon-transparency-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!