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>


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM