Transparent Window Sample

There's been some internal discussion about transparent and/or non-rectangular windows recently, and Nick Kramer recently addressed the issue in a blog post. Although I haven't had time to build a new solution that works with Avalon, I do have some older code that I've used to create layered windows in the past. Feel free to download the C# AlphaWindow solution for Visual Studio 2005 (the code originated in Visual Studio 2003). I don't know if this is the absolute best way to accomplish this, but it's worked for me in practice.

Basically, you have to provide a 32-bit image that includes an alpha channel (PNG). In the case of this example, the image is included as an embedded resource in the Visual Studio project. A quick look at the code should get you going. Notice that you can drag the window by clicking on any portion of the image that isn't completely transparent, including the drop shadow.

These windows work great for application splash screens where you display the window, do some start-up work, and hide it when you're done. You can also easily imagine Konfabulator-like functionality. I'd love to see someone adapt this to an Avalon sample. If you do this, share it with the rest of us in the Channel 9 Sandbox. Good luck!