












In WPF, it ships with three built-in BitmapEffect classes, namely DropShadowBitmapEffect, OuterGlowBitmapEffect and BlurBitmapEffect, you can think of those bitmap effects as those available in IE CSS, actually both of them do exactly the same thing, i.e add flashy look and feel to your UI display, here is some xaml code demonstrating how to use those BitmapEffects in WPF application:
<Border xmlns="http://schemas.microsoft.com/winfx/avalon/2005"
xmlns:x="http://schemas.microsoft.com/winfx/xaml/2005"
CornerRadius="30" Height="200" Width="800" Margin="20"
BorderThickness="4" BorderBrush="Red" Background="Green">
<StackPanel>
<StackPanel.Resources>
<BitmapEffectGroup x:Key="effects">
<DropShadowBitmapEffect Color="White" ShadowDepth="10" Softness="10"/>
<BlurBitmapEffect Radius="6" KernelType="Box"/>
</BitmapEffectGroup>
<OuterGlowBitmapEffect x:Key="outerglow"/>
</StackPanel.Resources>
<Label Margin="5,20,5,5" Content="Andriy Shevchenko" FontSize="80"
FontFamily="Segoe UI" FontWeight="Bold" BitmapEffect="{StaticResource effects}" />
<Label FontSize="20" Margin="240,0,5,5" FontFamily="Segoe UI"
Content="The Number One Striker In The World" BitmapEffect="{StaticResource outerglow}"/>
</StackPanel>
</Border>

As an off topic, Sheva a.k.a Andriy Shevchenko is my idol:-)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。