【发布时间】:2015-12-26 20:51:37
【问题描述】:
我刚刚购买了一些用于 WPF 功能区控件的图像集。图像完美无瑕;但是,它们无法在控件中正确呈现。
无论是小图像还是大图像都没有正确渲染。我尝试了不同的图像尺寸,但似乎没有任何区别。
我有一系列不同尺寸的图片可用。这是我的 XAML 的 sn-p。
<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 的新手,我很惊讶我必须与这样的问题作斗争。
有人知道如何让我的图片正确渲染吗?
【问题讨论】:
-
Images\paste.png的大小是多少? -
如问题所示,我尝试了不同的尺寸,包括 32x32 和 64x64。
-
我提到了确切的文件 (Images\paste.png) 并且没有提到大小(“不同”不是大小)。
-
它不能是任何尺寸,如果你指定
LargeImageSource它应该是32x32 at 96dpi。 -
The image files don't appear to specify DPI但LargeImageSource在 96 DPI 显示时应该是 32x32。