WPF中的Aero白光?

时间:2011-06-13 13:32:59

标签: wpf aero

如何在WPF中的控件后面添加Aero白色光晕?
我的意思是在Vista / 7的窗口标题栏中发光。

2 个答案:

答案 0 :(得分:2)

这个无关的问题似乎有答案......
Outer bevel effect on text in WPF

我在文本块后面只需要一个矩形...

    <Rectangle Height="{Binding ElementName=textBlock1, Path=ActualHeight}" HorizontalAlignment="{Binding ElementName=textBlock1, Path=HorizontalAlignment}" Margin="{Binding ElementName=textBlock1, Path=Margin}" VerticalAlignment="{Binding ElementName=textBlock1, Path=VerticalAlignment}" Width="{Binding ElementName=textBlock1, Path=ActualWidth}" Fill="White" Opacity="0.5">
        <Rectangle.Stroke>
            <SolidColorBrush />
        </Rectangle.Stroke>
        <Rectangle.Effect>
            <BlurEffect Radius="10" KernelType="Gaussian" />
        </Rectangle.Effect>
    </Rectangle>

当您替换代码中的所有"textBlock"时,这将为任何控件做诀窍!
它看起来和航空发光完全一样!

答案 1 :(得分:0)

this有帮助吗?效果可能非常微妙,但确实看起来不错。

我尝试使用Shazzam在WPF中搞乱使用Pixel Shaders,但实现相同或更好的效果需要付出很多努力。他们使用了许多“引擎盖下”的东西(例如双通着色器),其中的技术不适用于WPF API。

相关问题