I’m creating icons for my usercontrols using Paint.NET. I’d like to have proper transparency like 32 bit PNG or BMPX provides. Is there a way to achieve that? Looking at the toolbox, the regular Label control does seem to use a fully transparent icon (unless MS assumes an always white toolbox background?).
Currently I’m embedding my icons as bitmaps compiled to embedded resource, and use the ToolboxBitmapAttribute(Type, String) constructor. I tried using ICO or PNG or BMPX, but none of those work at all, they don’t even get displayed, whereas a simple BMP does get displayed (using the lower left corner pixel color as transparent color).
The built-in Winforms toolbox bitmaps use Color.Fuchsia as the background color. A pretty standard choice as the Bitmap.MakeTransparent() color, it is a nice fuchsed up color that is unlikely to cause unintended transparency in the rest of the image. Here’s the one for the Label control, retrieved from the System.Windows.Forms.dll assembly:
It got turned into a PNG while uploading it, it is actually a BMP.