【问题标题】:WPF Blurry bordersWPF 模糊边框
【发布时间】:2015-12-17 05:52:21
【问题描述】:

我在 WPF 项目的工作区中添加了一个进度条。我已经设置了 BorderBrush 颜色和背景颜色。在编辑器视图中一切正常。但是当我尝试运行我的应用程序时,边界变得模糊,我真的不知道为什么。

这是包含进度条的 StackPanel 代码:

<StackPanel Width="570px" Height="70px" HorizontalAlignment="Left" Margin="10,0,0,0">
    <ProgressBar Name="DownloadProgress" Width="570px" Height="30px"
                 Opacity="1" Background="#434551" BorderBrush="#2C2C38" BorderThickness="1"
                 VerticalAlignment="Top" HorizontalAlignment="Left"/>
    <Label Name="Status" Content="Updated to version 0.0.1567" Foreground="#6B7E7F"
                   Margin="0,5,0,0" HorizontalAlignment="Right" VerticalAlignment="Bottom">
    </Label>
</StackPanel>

这是它在编辑器中的样子:

这是运行后的样子:

【问题讨论】:

    标签: c# wpf render


    【解决方案1】:

    您只需在堆栈面板中将SnapsToDevicePixels 设置为true

      <StackPanel Width="570px" Height="70px" 
       HorizontalAlignment="Left" 
        Margin="10,0,0,0" SnapsToDevicePixels="True">
    

    也看here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-15
      • 1970-01-01
      • 2016-04-16
      • 1970-01-01
      • 2018-01-21
      • 2015-01-07
      相关资源
      最近更新 更多