与 WPF 中的 TransparencyKey 等效

Hos*_*her 5 c# wpf

在Win Form中,我们可以通过创建背景颜色为蓝色的位图来创建非矩形表单。因此,我们可以将其设置为 Win Form 的背景图像,并将 TransparencyKey 选项更改为蓝色,我们就有了一个异形窗口。

所以,我的问题是What is the equivalency to TransparencyKey in WPF that does like Win Form's TransparencyKey?

感谢您的关注 :)

Tho*_*que 2

没有同等的。
只需使用具有透明区域的图像(因此它必须是 PNG 或 GIF),将 设为WindowStyleNone将窗口背景设为Transparent,然后设为AllowTransparencytrue 。

透明区域将不可点击。