UsesPerPixelOpacity example

Lester Lobo posted an example of UsesPerPixelOpacity=true:

Keep in mind you don't need to use HwndSource -- you can use the Popup class instead, which is generally more convenient since it saves you some pinvoking.

Comments (5)

  1. Roland Hasenoehrl says:

    Popup is nice, but there is no "UsesPerPixelOpacity" property? Or is there any other way to implement transparency?  

  2. Jeff says:

    Note that there’s another sample showing the new UsesPerPixelOpacity stuff in the FebCTP version of the SDK. The sample is under "Cross-technology Samples" (unfortunately), and is called GadgetUILibrary. Defines a GadgetWindow class that you pass a Visual to and show … pretty much takes care of everything else.

  3. hasenoehrl says:

    Nice sample, but the transparency does not work on my machine. And second it also uses the HwndSource and some ugly Win32 calls. So do i miss something?

  4. Tomi B. says:

    Roland, I got transparency to work on a Popup by setting AllowsTransparency=true.

  5. Roland Hasenoehrl says:

    Ahh, thanks a lot. Now the Popup works with transparency and without any HwndSource and W32 stuff:-)

Skip to main content