ToolStripItem (Windows Forms) image not fully rendered

76 Views Asked by At

I have a weird problem with setting an image of a ToolStripItem (Windows forms). When I set an image like this:

ToolStripMenuItem oItem = new ToolStripMenuItem();
oItem.Text = Qit.WindowsStrings.WinStrings.Projects;
oItem.Name = "mnuProjects";
oItem.Image = MyResourceImages.GetImage(ResImages.Project32_n);

I see the image contours appear in the UI but the image is not fully rendered:

Image of ToolStripItem

The image itself (ResImages.Project32_n) is white on a transparent background (.PNG). If I use another image (of the same size and also a .PNG) which is fully colored and also has a transparent background the image is shown fine.

Image of ToolStripItem color

The ToolStripMenuItem is part of a StackStrip (SCSFContrib.CompositeUI.WinForms.Workspaces) with this background (hex) color: #363636.

Does anybody know why this image is not fully rendered? Maybe a white color on this background color doesn't render right or is the image itself the problem? I have checked the color image and the white image and they both have the same properties and quality so I don't understand why the white image does not render completely.

1

There are 1 best solutions below

0
r-m85 On

I have solved it now. It turned out the images where simply to small to be rendered in a high enough resolution/quality to be completely visible. The images I used were 32 by 32 pixels. I now use the same images in a format of 256 by 256 pixels and they are shown right.

The ToolStripMenuItem Images are apparently automatically scaled to fit so the bigger size does not make them fall out of their borders.