Welcome to MSDN Blogs Sign in | Join | Help

Support for layered windows

One piece of feedback we've heard loud and clear is that you want layered windows.  Well, I'm happy to announce that based on your feedback, we now plan to officially support layered windows in WPF 1.0, coming to a future CTP near you (not necessarily the next CTP, though, it will be the next CTP with major WPF changes).

The details: HwndSource (or more accurately, HwndSourceParameters) will have a constructor parameter for UsesPerPixelOpacity.  Setting this to true will enable layered windows w/ a per-pixel alpha channel.  Window will behave the same as today -- UsesPerPixelOpacity=false, but Popup change to UsesPerPixelOpacity=true.  UsesPerPixelOpacity=true has a couple implications:

  • All rendering for that hwnd will be done in software (no hardware acceleration)
  • We won't draw a window frame (no WS_CAPTION)
  • Transparent pixels will not be hit test or get mouse input
  • HwndHost is not supported inside a UsesPerPixelOpacity=true container

The last three stem directly from Win32k.sys's layered windows behavior.  In terms of hardware acceleration, we're still trying to work out what's possible on various platforms with reasonable performance & reliability, but didn't want to block all progress on that investigation.

Standard disclaimer -- all product plans are subject to change, this is not a guarantee, etc. etc.

Published Wednesday, December 14, 2005 5:40 PM by nkramer

Comments

Wednesday, December 14, 2005 2:12 PM by Themes

# re: Support for layered windows

Really nice news!

If you will not do it, we have to do some hard workarounds. Thank you to free our hands :-)
Wednesday, December 14, 2005 2:28 PM by Anonymous

# re: Support for layered windows

"All rendering for that hwnd will be done in software (no hardware acceleration)"

Would be interesting to hear why. Since layered windows need to be composited, I assume they will be hardware RGBA textures at some point. Hardware (TNT and up) has no problems rendering to RGBA textures, writing Alpha.

So, why no hw accel?
Wednesday, December 14, 2005 11:46 PM by andy

# re: Support for layered windows

Cool!
Thursday, December 15, 2005 2:00 PM by Florian Krüsch

# re: Support for layered windows

I assume that will not a Vista only feature?
Friday, December 16, 2005 3:02 AM by Joku

# re: Support for layered windows

> Would be interesting to hear why. Since layered windows need to be composited, I assume they will be hardware RGBA textures at some point. Hardware (TNT and up) has no problems rendering to RGBA textures, writing Alpha.

I'd also like to hear what's the major difficulty with doing this in HW.

But if I could choose between better gfx transparency tricks such as layered windows and the ability to have a managed stream as source for video/audio easily, I'd go with the latter.




Wednesday, February 22, 2006 10:29 PM by Nick on Windows Presentation Foundation (Avalon)

# My favorite February CTP features

It's out, and there's been a lot of great work since the last major CTP.   Layered Windows...
Monday, February 27, 2006 5:51 AM by Florian Krüsch

# re: Support for layered windows

that's great news :) Is it still true that it's not hardware accelerated at all or did you find a way for that?
Friday, December 08, 2006 7:26 PM by On .net client stuff..

# transparent windows in WPF.. please make them small :)

A feature that the WPF team added late to WPF was the ability to allow transparent windows ( property

New Comments to this post are disabled
 
Page view tracker