Images do not render correctly in WPF ribbon control

让人想犯罪 __ 提交于 2020-01-04 05:56:48

问题


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.

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>

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?


回答1:


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.



来源:https://stackoverflow.com/questions/34475138/images-do-not-render-correctly-in-wpf-ribbon-control

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!