原文:
WPF透明设置(Opacity)
<TextBlock Text="阴影效果" FontSize="32"></TextBlock> <Border Height="50" Width="200" Background="Blue"></Border>
<TextBlock Text="阴影效果" FontSize="32"></TextBlock> <Border Height="50" Width="200" Background="Blue" Opacity="0.5"></Border>
渐变透明
<TextBlock Text="阴影效果" FontSize="32"></TextBlock> <Border Height="50" Width="200" Background="Blue"> <Border.OpacityMask> <LinearGradientBrush StartPoint="0,0" EndPoint="1,0"> <GradientStop Offset="0" Color="Blue"></GradientStop> <GradientStop Offset="1" Color="Transparent"></GradientStop> </LinearGradientBrush> </Border.OpacityMask> </Border>