zoukankan      html  css  js  c++  java
  • WPF Effect 造成的字体模糊

    WPF 里面有个Effect ,暂且可以理解为 “特效” 分类。

    但是有时候使用不恰当,容易出现各种毛病。

    例如:

    代码如下:

    <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" Orientation="Horizontal">
            
            <Border Width="200" Height="100" Background="#5Eb978">
                <Border.Effect>
                    <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
                </Border.Effect>
                <TextBlock Text="这个是错误示范" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="25"></TextBlock>
            </Border>
    
            <Grid Width="200" Height="100" Margin="30,0,0,0">
                <Border Width="200" Height="100" Background="#5Eb978">
                    <Border.Effect>
                        <DropShadowEffect BlurRadius="10" ShadowDepth="0"/>
                    </Border.Effect>
                </Border>
                <TextBlock Text="正确示范" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="25"></TextBlock>
            </Grid>
    
    
        </StackPanel>
    

      

    提示:Border 级使用 Effect 造成 TextBlock 模糊。所以不能直接在有DropShadowEffect的Border内部添加展示元素。

    作者:Dream.Machine (944095635)
    网站:http://www.dmskin.com
    博客:http://www.cnblogs.com/DMSkin
    开源:https://github.com/944095635
    关于作者:专注于 WPF开发、C# 开发。
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明.
    在文章页面位置给出原文连接,如有问题,可以通过944095635@qq.com 联系我,非常感谢。
  • 相关阅读:
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
    LeetCode
  • 原文地址:https://www.cnblogs.com/DMSkin/p/8395052.html
Copyright © 2011-2022 走看看