我刚刚购买了一些与 WPF Ribbon 控件一起使用的图像集。图像完美无瑕;但是,它们在控件中无法正确呈现。
小图像或大图像都未正确渲染。我尝试过不同的图像尺寸,但似乎没有任何区别。
我有一系列不同的图像尺寸可用。这是我的 XAML 的片段。
<RibbonTab Header="Edit">
<RibbonGroup Header="Clipboard">
<RibbonButton Label="Paste" LargeImageSource="Images\paste.png" ToolTipFooterTitle="" ToolTipImageSource="Images/paste_sm.png" ToolTipTitle="Paste" ToolTipDescription="Insert text from the clipboard at the current location"></RibbonButton>
<RibbonButton Label="Cut" SmallImageSource="Images\cut_sm.png" ToolTipDescription="Cut the selected text" ToolTipTitle="Cut" ToolTipImageSource="Images/cut.png"></RibbonButton>
<RibbonButton Label="Copy" SmallImageSource="Images\copy_sm.png" ToolTipDescription="Copy the selected text" ToolTipTitle="Copy" ToolTipImageSource="Images/copy.png"></RibbonButton>
<RibbonButton Label="Select All" ToolTipDescription="Select all text in document" ToolTipTitle="Select All"></RibbonButton>
</RibbonGroup>
</RibbonTab>
我是 WPF 新手,我很惊讶我必须与这样的问题作斗争。
有人知道如何使我的图像正确渲染吗?
最佳答案
尝试 RenderOptions.BitmapScalingMode
的几个不同选项在功能区按钮上。我发现有时 NearestNeighbor
效果更好。 UseLayoutRounding="True"
也可能有帮助。
关于c# - 图像在 WPF 功能区控件中无法正确呈现,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34475138/