【发布时间】:2015-05-10 07:23:28
【问题描述】:
如果大图像以小于原始尺寸显示,则开始显示伪影“像素化”:
https://habrastorage.org/files/8a6/198/506/8a61985069cb4d0097540bf0d07f4a68.png
但这可以通过在XAML中指定对象的属性来解决,缩放算法质量更高:
<Image Height="50" Width="50"
Source="Resources/logo.png"
RenderOptions.BitmapScalingMode="HighQuality" /><!-- Scaling Mode -->
然后,图像看起来很好:
https://habrastorage.org/files/819/863/48f/81986348f9ab454a9d6b676d88321d0a.png
问题。如何更改应用于窗口中图标的缩放算法? 通过 XAML 设置的图标(最后一行):
<Window x:Class="MyApp.AboutWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/present"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:res="clr-namespace:MyApp.Properties"
Title="{x:Static res:Resources.AboutWindowTitle}"
Height="450" Width="300"
ResizeMode="NoResize"
WindowStartupLocation="CenterOwner"
Icon="Resources/info.png"><!-- Icon -->
标题栏中的图标如下所示:
_https://habrastorage.org/files/946/bb7/67b/946bb767b66042aba985a8e55a21b078.png(抱歉,我没有足够的声望来发布第三个链接)
属性 RenderOptions.BitmapScalingMode = "HighQuality" 应用于窗口,没有给出任何内容。
【问题讨论】:
-
可能是duplicate..