2016-03-09 31 views
2

我有一個在Windows 10上開發的wpf應用程序,我現在在x86 windows 8平板上嘗試過。WPF筆刷顏色從win10更改爲win8平板電腦

在平板電腦上運行時,某些前景顏色顯示不同(特別是黑色變爲藍色,白色變爲黃色)。

更改顯示在文本塊,標籤,按鈕內容文本和數據網格標題上。

另一方面,"Red"或任何其他非常暗或非常亮的十六進制顏色將按預期顯示。

然後再次,我有一些Canvas元素有填充畫筆定義爲黑色或白色,他們正確渲染。

測試用例:

<Window Background="#FF808080"> 
<Grid Margin="10"> 
    <Grid.ColumnDefinitions> 
     <ColumnDefinition Width="*"/> 
     <ColumnDefinition Width="*"/> 
    </Grid.ColumnDefinitions> 
    <!-- labels --> 
    <StackPanel Orientation="Vertical" Grid.Column="0"> 
     <StackPanel.Resources> 
      <Style TargetType="Label"> 
       <Setter Property="FontSize" Value="30"/> 
      </Style> 
     </StackPanel.Resources> 
     <Label Foreground="Black">Black</Label> 
     <Label Foreground="Red">Red</Label> 
     <Label Foreground="White">White</Label> 
    </StackPanel> 
    <!-- graphics --> 
    <StackPanel Orientation="Vertical" Grid.Column="1" Margin="10 0 0 0"> 
     <Ellipse Width="100" Height="100" Fill="Black"/> 
     <Ellipse Width="100" Height="100" Fill="Red"/> 
     <Ellipse Width="100" Height="100" Fill="White"/> 
    </StackPanel> 
</Grid> 
</Window> 
從平板電腦的Win8和桌面win10(按順序)

截圖: http://imgur.com/a/1WJRI

SOLUTION使用的軟件與RenderOptions.ProcessRenderMode = RenderMode.SoftwareOnly;

渲染

力窗口

現在下一個問題是GPU加速渲染影響文本顏色的原因,以及如何特別改變這一點。我的應用程序不是圖形沉重的,所以我現在只需啓用sw渲染並完成此操作。

回答

相關問題