zoukankan      html  css  js  c++  java
  • 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联系群主。

  • 相关阅读:
    leetcode目录
    Windows下tuxedo配置
    实习总结
    n人比赛,可轮空,比赛轮数和场数
    Ubuntu中Eclipse安装与配置
    Lunix中文乱码解决方案
    tuxedo入门
    useradd和adduser的区别
    每个位上都是素数
    TUXEDO错误解决方案
  • 原文地址:https://www.cnblogs.com/xietianjiao/p/9268500.html
Copyright © 2011-2022 走看看