RibbonButton icon gets distorted if width/height is set

Ribbon for WPF Forum

Posted 7 years ago by Ansgar
Version: 16.1.0636
Avatar

If I set aWidth and/or Height on a RibbonButton in a Ribbon the Icon gets distorted.

<ribbon:Button
Label="Machine Focus" Width="75"
ImageSourceLarge="{StaticResource focusMachine}"
Click="btnFocusMachine_Click" />
<ribbon:Button
Label="Machine Focus"
ImageSourceLarge="{StaticResource focusMachine}"
Click="btnFocusMachine_Click" />

How can I get Buttons of euqal width without distorting the icon?

Best regards,
Ansgar

Comments (3)

Posted 7 years ago by Ansgar
Avatar

[Modified 7 years ago]

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

It's probably trying to center the image (which is likely 32x32 size) in your 75px, which means it will be blurry.  If you make a fixed width button, you'd need to make it an even number so the image centers without bluriness.  But I don't recommend making fixed width buttons at all, since they should be sized according to their real desired sizes in ribbon.


Actipro Software Support

Posted 7 years ago by Ansgar
Avatar

Thanks. Your solution works.

Best regards,
Ansgar

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.