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.

-Pascal

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

@andheum

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.

Bests,
Keyu Gan

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

Bests,
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 plagued 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.
:frowning:

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
D20_IMG_Rafraichir


Maybe Human UI ā€œthinksā€ they are 16 ppiā€¦