如何在WPF中的控件后面添加Aero白色发光?
我指的是Vista/7中窗口标题栏中的发光效果。
发布于 2011-06-13 22:05:32
这个不相关的问题似乎有答案...
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>当您替换代码中的所有时,这将为任何控件做好准备!
它看起来和空气中的光芒一模一样!
发布于 2011-06-13 21:41:04
this有帮助吗?效果可能相当微妙,但看起来确实不错。
我试着使用Shazzam在WPF中摆弄Pixel Shaders,但要达到同样的效果或更好的效果需要做很多工作。它们使用了许多“幕后”的东西(比如双通道着色器),而这些技术对于WPF api是不可用的。
https://stackoverflow.com/questions/6331131
复制相似问题