• WPFの阴影效果


    UI实现过程中有的需要实现投影效果,那么怎么实现呢?整理了几种方式,供参考和查阅

    1、图片做成阴影效果的,这个不多说了,和美工小姐姐多共同就好了

    2、控件的DropShadowEffect属性

            <StackPanel Background="#FFFFFF" Width="941" Height="585">
                <StackPanel.Effect>
                    <DropShadowEffect Color="#3699dd" Opacity="0.33" ShadowDepth="4" 
                                      Direction="180" BlurRadius="40" RenderingBias="Performance" />
                </StackPanel.Effect>
            </StackPanel>

    上面的几个子属性名字很简单易懂

    3、模糊效果类BlurEffect

    <TextBlock Text="Hello world" Foreground="red" HorizontalAlignment="Center" Margin="20" FontSize="36">
                <TextBlock.Effect>
                    <BlurEffect Radius="4" KernelType="Box" />
                </TextBlock.Effect>
    </TextBlock>

    4、TranslateTransform来叠两个同样的东西(当然可以颜色不一样)来显示弄出阴影效果

    <Grid>
    <TextBlock Text="helloworld" Foreground="Black" HorizontalAlignment="Center" Margin="20" FontSize="36">
    <TextBlock.RenderTransform>
    <TranslateTransform X="3" Y="3" />
    </TextBlock.RenderTransform>
    </TextBlock>
    <TextBlock Text="helloworld" Foreground="Green" HorizontalAlignment="Center" Margin="20" FontSize="36" />

    </Grid>

     如有疑问,请加群568055323联系群主。

  • 相关阅读:
    GC 的认识
    SSRF 攻击技术
    文件包含漏洞
    文件的上传和下载
    XSS
    SQL注入工具 sqlmap
    自动化测试框架
    mac配置环境变量
    pycharm与git想集成 上传下载代码
    测试人员需要掌握的linux基本操作
  • 原文地址:https://www.cnblogs.com/xietianjiao/p/9268500.html
Copyright © 2020-2023  润新知