I’ve written a little system tray application that uses a NotifyIcon to display the status of a process. I’m loading a high quality 64 by 64 png formatted icon in the following way:
Bitmap rawImage = new Bitmap(Assembly.GetExecutingAssembly().GetManifestResourceStream("Snitch.Icons.Loading.png"));
m_icon.Icon = Icon.FromHandle(rawImage.GetHicon());
However the icon that appears in the system tray never looks as good as my source icon, is there an setting or something I am missing? I’ve tried the 16×16, 32×32 eight bit icon files that VS2008 creates but they don’t seem to fair any better.
Consider the quality of a thumbnail image relative to a full-size photograph; now imagine shrinking the entire photo down to 16×16 pixels. The greater the discrepancy between the original size and the new size, the worse the result will look, no matter whether you’re shrinking or stretching.
The best thing to do, if you can, is obtain or create an .ico file that actually contains separate 16×16, 32×32, 48×48 and 64×64 icons. The next best thing is probably to use a plain 16×16 icon for the notification area. Any image resizing/resampling is going to look distorted.
There are a number of sites on the web with free or inexpensive downloads of multiple-sized or 16×16 icons. There are already several questions here on where to find icons so I won’t try to start listing sites myself.