Question

I'm using Ribbon from RibbonControlsLibrary.dll 4.0.0.11019, .NET 4.0, C#, WPF. It can be downloaded with a free samples here: http://www.microsoft.com/en-us/download/details.aspx?id=11877

The problem comes when a RibbonToggleButton is displayed. Then it's image seems to be a little bit broken, like a part of image is shifted for a few pixels.

EDIT: Thanks to kind people I can post and image now:

Same image for 1-line <code>RibbonToggleButton</code> and 2-line

Here are some details:

  1. Image is displayed in it's large variant
  2. Image size is 32x32
  3. I set image scaling to none for all the images of Ribbon
  4. Image is broken only when the text in RibbonToggleButton has 1 line
  5. Same image displays correctly in any other kind of button (RibbonButton, RibbonSplitButton etc.)
  6. The image is displayed correctly when I set the font size in Windows to Medium (125%)
  7. My OS is Windows 8
  8. When I set the VerticalContentAlignment for the toggle button to "Bottom", the Image starts to display correctly, but the whole Ribbon starts to look ugly.

I experience this problem for all the toggle buttons, including those which are in a Microsoft's free samples.

I guess that probably the Image doesn't have enough space, so it's compressed from 32x32 to some smaller size.

I use the theme that is made of Microsoft's Generic theme, that is included in the RibbonControlsLibrary.dll. I guess I could fix the RibbonToggleButton template somehow, but I have no idea what to fix there.

Any ideas?

Was it helpful?

Solution

In the xaml declaration of your UserControl / Window put that line:

RenderOptions.BitmapScalingMode="HighQuality"
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top