Nutty Custom-Shaped WinForm BG
Posted on 2006-11-10
I have a lovely WinForm that uses a custom shape. The bitmap used in its BackgroundImage property has a transparent color, and the WinForm has that TransparencyKey property and I have all that set correctly. Works great.
But what I really want my form to be able to do is to set its own BackgroundImage property dynamically, using an on-board ImageList control.
Problem is, when I dynamically have the form set its own background image, I lose that wonderful transparency. Suddenly, the entire image that I use to create my custom-shaped form is visible, in all its ugliness. The color that should be transparent (white) is suddenly opaque (black). All because rather than setting my form's BackgroundImage property at design-time and compiling it in, I'm trying to dig it out of an ImageList.
Any ideas on how I can get dynamic background images to work here? I don't want to load them from a subfolder on the fly or anything kooky like that. The images need to be on-board.