I am experiencing very weird issues surrounding Images. I have a settings window, which has a ListView on the left hand side which has various image icons which when clicked update the panel to the right to display relevant stuff – nothing hugely special.
However, I have recently added two extra icons, but their images are not being displayed correctly and I can’t for the life of me figure out why. I’ve tried various different image formats (png, jpg, gif, bmp) and none of them display correctly. I’ve tried it on another computer to see if it was my installation of .NET but the error persisted.
I’d be happy if every image displayed incorrectly, but unfortunately its just these two, and perhaps any other image I add now.
Has anyone got any ideas – I’m all out of them…
Here is what it looks like when it runs…

Here is the same resource file as shown in visual studio…

The other one…

The other images render absolutely fine, such as this one…
This is caused by the ImageList that stores these images. You’ve left the ColorDepth property to the default, Depth8Bit. Which forces Windows to convert these images with high color content (note the subtle gradient in the arrows for example) to a pixel format that can store only 256 distinct colors. That’s a lossy conversion and causes artifacts.
Change the property to Depth32Bit.