• wpf-效果


    1.BlurEffect 模糊效果

    通过设置Radius属性的值可以改变模糊程度,Radius默认值为5

    <Button Content="btn2" Width="100" Height="20">
                <Button.Effect>
                    <BlurEffect Radius="3"/>
                </Button.Effect>
            </Button>

    2.DropShadowEffect 阴影效果

    常用属性

          Clolor :设置阴影的颜色(默认是黑色)

      ShadowDepth:确定阴影离开内容多远。默认值为5像素。

      BlurRadius: 模糊阴影,也就是BlurEffect类中的Radius属性相似,模糊程度。

      Opacity:使用从1到0之间的小数使阴影部分透明。

      Direction:使用从0到360之间的角度值指定阴影相对于内容的位置。

        <Grid>
            <Button Content="btn1" Width="100" Height="20"  Margin="100,50,0,0"  HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button.Effect>
                    <DropShadowEffect/>
                </Button.Effect>
            </Button>
            <Button Content="btn2" Width="100" Height="20"  Margin="100,100,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button.Effect>
                    <DropShadowEffect Color="LightBlue"></DropShadowEffect>
                </Button.Effect>
            </Button>
            <Button Content="btn3" Width="100" Height="20"  Margin="100,150,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button.Effect>
                    <DropShadowEffect BlurRadius="15"></DropShadowEffect>
                </Button.Effect>
            </Button>
            <Button Content="btn4" Width="100" Height="20"  Margin="100,200,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button.Effect>
                    <DropShadowEffect ShadowDepth="0"></DropShadowEffect>
                </Button.Effect>
            </Button>
            <Button Content="btn5" Width="100" Height="20"  Margin="100,250,0,0" HorizontalAlignment="Left" VerticalAlignment="Top">
                <Button.Effect>
                    <DropShadowEffect ShadowDepth="20" BlurRadius="2" Color="LightBlue" Direction="315"></DropShadowEffect>
                </Button.Effect>
            </Button>
    
        </Grid>

  • 相关阅读:
    静态成员在类中的初始化
    博客中尖括号不显示的问题
    声明vector对象保存函数指针
    返回数组指针的函数
    C++ 指针与引用的差别
    Configure Eclipse “Content Assist”
    How to install Eclipse-Color-Theme
    国内 git 托管平台
    SHA1 对文件求信息摘要的实现
    SHA1 对字符串求摘要的实现
  • 原文地址:https://www.cnblogs.com/dangnianxiaoqingxin/p/12902240.html
Copyright © 2020-2023  润新知