在WPF功能区控件中无法正确渲染图像 [英] Images do not render correctly in WPF ribbon control

查看:186
本文介绍了在WPF功能区控件中无法正确渲染图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚购买了一些与WPF功能区控件一起使用的图像集.图像完美无瑕;但是,它们在控件中无法正确呈现.

I just purchased some image collections for use with the WPF Ribbon control. The images are immaculate; however, they do not render correctly in the control.

无论大小图像都无法正确渲染.我尝试了不同的图像尺寸,但似乎没有任何区别.

Neither the small or large images are not rendered correctly. I've tried different image sizes but it doesn't seem to make any difference.

我有一系列不同的图像尺寸可用.这是我的XAML的代码段.

I have an array of different image sizes available. Here's a snippet of my 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的新手,我为不得不面对这样的问题感到惊讶.

I'm new to WPF and am amazed that I have to struggle with issues like this.

有人知道如何正确渲染我的图像吗?

Does anyone know how to make my images render correctly?

推荐答案

尝试也可能有帮助.

Try a few different options for RenderOptions.BitmapScalingMode on the RibbonButtons. I've found that sometimes NearestNeighbor works better. UseLayoutRounding="True" may help as well.

这篇关于在WPF功能区控件中无法正确渲染图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆