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>

posted @ 2016-06-30 18:32  高效养猪倌  阅读(10176)  评论(0编辑  收藏  举报