0

I've been charged with fixing a bug in a WPF application even though I don't really do much WPF.

Can't figure it out so am asking you wonderful readers of stackoverflow.

I have a RibbonButton with an image specified as a LargeImageSource. Trouble is, the image is very pixelated. So I tried creating a child of the to see if it would render that way. No luck.

If I just create an image outside of the RibbonButton then it displays correctly so I know the markup for the image is correct. I don't know much about WPF, but I do know that you're supposed to be able to create child elements that will render inside their parents. Am I misunderstanding?

The code is as follows:

<ribbon:RibbonButton Label="{Binding Path=RefreshTitle, Source={StaticResource CultureResources}, Mode=OneWay}"  
 Command="{Binding Path=FetchWorksOrdersCommand}"
 ToolTip="{Binding Path=RefreshReportTitle, Source={StaticResource CultureResources}, Mode=OneWay}">
    <Image Source="images\Refresh.png" VerticalAlignment="Top" HorizontalAlignment="Left"></Image>
</ribbon:RibbonButton>              

Refresh.png is 32x32. I've tried SnapToDevicePixels without success.

Looking forward to your responses!

Mark

Anatoliy Nikolaev
  • 22,370
  • 15
  • 69
  • 68
serlingpa
  • 12,024
  • 24
  • 80
  • 130
  • 1
    How did you try to set the child? Can you show some code? What's your image's size in pixels? Large is 32x32, Small is 16x16. Setting the wrong image will result in pixelation – Panagiotis Kanavos Jul 11 '13 at 09:31
  • You can use SnapsToDevicePixels="True" See this [link](http://msdn.microsoft.com/en-us/library/aa970908%28v=vs.85%29.aspx) – Mohd Ahmed Jul 11 '13 at 09:32

0 Answers0