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联系群主。

  • 相关阅读:
    能量项链
    开学前最后一天信奥赛一本通重刷日记
    重刷信奥赛一本通日记-3
    重刷信奥赛一本通日记-2
    重刷信奥赛一本通日记-1
    第二次考试题解way
    第一次考试题解
    第一次考试感言
    「HNOI2012」矿场搭建
    「HAOI2006」受欢迎的牛
  • 原文地址:https://www.cnblogs.com/xietianjiao/p/9268500.html
Copyright © 2011-2022 走看看