WPF模糊和阴影效果

  1. 云栖社区>
  2. 博客>
  3. 正文

WPF模糊和阴影效果

nurmemet 2019-04-10 20:47:32 浏览410
展开阅读全文

        <Button Content="Button" HorizontalAlignment="Left" Margin="31,234,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="-0.213,0.579">
            <Button.Effect>
                <BlurEffect Radius="2"/>
            </Button.Effect>
        </Button>

        <TextBlock FontSize="20" Margin="5">
            <TextBlock.Effect>
                <DropShadowEffect></DropShadowEffect>
            </TextBlock.Effect>
            <TextBlock.Text>阴影效果</TextBlock.Text>
        </TextBlock>
        <TextBlock FontSize="20" Margin="127,10,-117,0">
            <TextBlock.Effect>
                <DropShadowEffect Color="SteelBlue"></DropShadowEffect>
            </TextBlock.Effect>
            <TextBlock.Text>阴影效果</TextBlock.Text>
        </TextBlock>
        
        <TextBlock FontSize="20" Margin="251,10,-241,0" Foreground="White" >
            <TextBlock.Effect>
                <DropShadowEffect BlurRadius="15"></DropShadowEffect>
            </TextBlock.Effect>
            <TextBlock.Text>阴影效果</TextBlock.Text>
        </TextBlock>

        <TextBlock FontSize="20" Margin="251,10,-241,0" Foreground="Magenta" >
            <TextBlock.Effect>
                <DropShadowEffect ShadowDepth="0"></DropShadowEffect>
            </TextBlock.Effect>
            <TextBlock.Text>阴影效果</TextBlock.Text>
        </TextBlock>
        <TextBlock FontSize="20" Margin="5,93,5,-83" Foreground="Magenta" >
            <TextBlock.Effect>
                <DropShadowEffect ShadowDepth="25"></DropShadowEffect>
            </TextBlock.Effect>
            <TextBlock.Text>阴影效果</TextBlock.Text>
        </TextBlock>

运行效果图
image

网友评论

登录后评论
0/500
评论
nurmemet
+ 关注