Button gets the .PNG image size wrong

I had set an image for a button but realized it was much too big.
I resized it and copied it to a new name, set the path to that new file, and the button stayed the same size, but with a blurry icon.

Here is the resized image :
D20_IMG_Bouton filtre vide gris fonce 50x50

Hello - toolbar buttons use three bitmap sizes - you need to edit all three for them all to look correct.


Oh damned, why do I end up here : this was intended for Grasshopper / Human UI

My question has nothing to do with Rhino’s buttons


Any idea what’s causing this bloated button phenomenon ?

If I reconnect the path of the image to the button component, the size goes back to normal ; “normal” being the size that was set through the “adjust element positioning” component.

Please, anyone : am I alone with this ?
I’d like to use icons in my Human UI definitions, but I’m stuck with texts until I solve this ussue.

I cannot reproduce the issue by changing between large & small icons with such code:

Hi Keyu,

thanks for your test.
Today, I have a new flavor of bizarre : the button stays small when I refresh, but if it’s not connected to an “AdjustPos” component, it will inflate again…

Just to make it clear : what library does Human UI use ? ETO or Windows Forms ?

Neither. Windows Presentation Framework.

Keyu Gan

Maybe you can upload that part of your definition and the images you were using

Keyu Gan

OK here it is :
BIG icons.gh (27.7 KB)

I serialized / internalized the images.
The bug still manifests.

Could this interfere with ETO elements in Rhino ?
We’ve been plagues with empty ETO pop-ups and tabs for three years now, and recently, with Human UI windows active, activating a Rhino ETO window crashes Rhino.

No. Eto & WPF & WinForm are basically three things, which I guess is also part of the reason why Andrew doesn’t actively work on HumanUI …

Ugh… just crashed again.
The only thing I get is this crash log file :
RhinoDotNetCrash.txt (6.9 KB)

It says something about it being " impossible to find ressource ‘iconbutton/themes/aero2.normalcolor.xaml’ "

That file is present on my hard drive :

But looking at the crash file, I see two mentions of a path that doesn’t exist on my computer since I have no “D:” drive :

Maybe there’s something special about the French localization of Windows …

Anyways, do you see the big icons bug with my file, on your side ?

yes. let me see waht happened

Eto is WPF on Windows Rhino.

Hi Steve, did you have a look at the crash log ?

:shushing_face: Yes But I suppose @osuire wants to mix them, a.k.a, use them together?

Ok, so you get the swollen icons too, right ?

That’s fine as long as you are only developing for Windows. You can mix WPF with Eto. Look at the crash that was posted here; you can see that it is just WPF.

@curtisw can you take a look at this? I’m having trouble deciphering what is happening. It may be the reason Olivier has had problems with WPF for so long… or maybe not.

@osuire the crash is happening because human-ui includes an old version of Xceed.Wpf.Toolkit.dll (3.0), which is incompatible with the version that is shipped with Rhino (3.6). Due to the way we handle assemblies in Rhino, this causes a conflict if the human-ui version loads before the one shipped with Rhino.

If you remove (or rename) that assembly from the human-ui plugin it shouldn’t crash. I’ve created RH-62909 to look into a way to get around that if possible without causing other issues.

As for your issue with image sizes, your source image appears to be saved with 16 Pixels Per Inch. WPF looks at this to determine what size to show it at. Windows is by default 96 PPI, so 32 pixels * 96 / 16 = 192 logical pixels. If you edit the image and re-save it at 96 PPI, then it should show at the expected size.

Hope this helps!

Hi Curtis,

I renamed the dll, restarted Rhino, and still got the crash.
I deleted the dll, restarted Rhino, and still got the crash.
The Human UI interface works though.

I checked the source images, and they are saved with 96 ppi

Maybe Human UI “thinks” they are 16 ppi…