Question

RibbonButton icon gets distorted if width/height is set

Posted 10 months ago by Avatar Ansgar

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 10 months ago by Ansgar

https://imgur.com/a/KB9Cg

[Modified 10 months ago]

Posted 10 months ago by Actipro Software Support - Cleveland, OH, USA

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 10 months ago by Ansgar

Thanks. Your solution works.

Best regards,
Ansgar

Information The latest build of this product (2018.1 build 0671) was released 1 month ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.