Question

RibbonButton icon gets distorted if width/height is set

Posted 1 year 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 1 year ago by Ansgar

https://imgur.com/a/KB9Cg

[Modified 1 year ago]

Posted 1 year 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 1 year ago by Ansgar

Thanks. Your solution works.

Best regards,
Ansgar

Information The latest build of this product (2018.1 build 0673) 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.