Shaped Avalon application with full alpha-transparency

Is it possible to create a shaped Avalon app Some kind of shaped opacity mask that will clip the app

I also need to be able to animate this mask during certain operations.

Is it possible to do this, similarly to how it' s done with WinForms apps, except with full alpha transparency

Thanks for any help,

Corey



Answer this question

Shaped Avalon application with full alpha-transparency

  • Izhido_

    I took a look at your vector-based sample apps. Very cool indeed. Do you know of any sample code that I could review to guide me in using Interop and this UpdateLayeredWindow method

    Thanks!

    Corey


  • Andy_B

    my algortihm is probably not as optimized as it could be because it is only a prototype; however, i would guess that much of it has to do with doing software rendering of the window on every pass using managed bitmaps, then passing those over to the GDI functions. since WPF is set up to use DirectX and the graphics hardware, you lose all that when you go to do a software rendering.
  • william123

    as of the current bits, it is not possible to do what you want to do strictly using WPF. MSFT has annouced that they will support per-pixel alpha for toplevel windows, but it's not clear when any version of that functionality will be available.

    that said, you can use interop with layered windows to achieve the effect you want. look at the GadgetUILibrary sample for a way to do nonrectangular toplevel windows. (note: it's built against sept. bits so you have to port it.)

    however, that's only part of the work. to actually get full per-pixel alpha you would need to render the window yourself each frame by drawing it offscreen and then using GDI (BitBlt, etc.) to draw it on the screen so that it blends properly. performance using this technique is bad, but if you want it today, that's what you have to do.


  • Tito Perez

    Why is WPF so slow for bitmap rendering

  • zuoliang

    The performance can be excellent, we have found, almost as good as non-alpha blended windows:

    http://www.vgdotnet.com/articles/translucent_calculator.shtml



  • PeterTPeterT

    GDI+ -- I was talking about the performance of UpdateLayeredWindow, which is excellent.

  • Rob_72

    There are samples in msdn, if you search for the API call UpdateLayeredWindow.

  • David Botzenhart

    sure, the perf of UpdateLayeredWindow is fine, but you have to actually get the bits there to draw. that's where the rendering bottleneck is for WPF.
  • Sridhar

    are you running your code against the WPF bits or GDI+
  • Shaped Avalon application with full alpha-transparency