WinFX/Avalon and transparent windows

April 5, 2006 00:58 by docbliny 

EDIT: Daniel reminded me I should update my blog once in an eternity. Please see his comment for RTM info:

This information is a bit dated.  With the RTM release, you can now do the following:

    Window window = new Window();
    window.AllowsTransparency = true;
    window.WindowStyle = WindowStyle.None;

This will create a borderless window that allows transparently.  Regarding software acceleration, you'll find this interesting:

http://blogs.msdn.com/seema/archive/2006/10/25/layered-windows-sw-is-sometimes-faster-than-hw.aspx

Regards,
- Daniel

Original outdated post:

Just a quick tip. If you've searched online for a way to make a transparent, borderless, or shaped window in WPF (formerly known as Avalon) and you've found the Win32 Interop method of HwndSource and UsesPerPixelOpacity, you might want to just switch to using a Popup with AllowsTransparency set to True. Just remember that currently (February 2006 CTP) this will mean that hardware acceleration won't be used (oh please, please, please add hardware support...)


Add comment

  Country flag

biuquote
  • Comment
  • Preview
Loading