Can not use Script.LoadImage nor DOpus.LoadImage for a button control "image" property

Trying to add custom images to buttons :
What works
If I set the image property in the designer, it works if I provide a full path to an image or the reference of an internal icon (e.g. #iconName).
Note that I can not set the image to an image included in the .osp package that way (which is expected, I have to use LoadImage for that ... but ...)

What I can't make work
Use Script.LoadImage or DOpus.LoadImage to assign result to image property for the button.
If I use an external file path, I get nothing but the text of the button (label property is set to yes).
dlg.control("btNewCfg").image = Script.LoadImage("C:\\Users\\Stephane\\AppData\\Roaming\\GPSoftware\\Directory Opus\\Images\\add.png");
gives me :
image

If I use the name of an image inside the .osp package (e.g. dlg.control("btNewCfg").image = Script.LoadImage("add.png");), or if I call DOpus.LoadImage on an external file (dlg.control("btNewCfg").image = DOpus.LoadImage("C:\\Users\\Stephane\\AppData\\Roaming\\GPSoftware\\Directory Opus\\Images\\add.png"); ) I get some kind of "default" file icon but not my image :
image

Note that it works with a static control (static1.Title = Script.LoadImage("add.png") or static1.Title = Script.LoadImage("/full/path/to/add.png") ).
So I suspect an issue with the buttons only (image property set method ?) or something I'm not doing correctly on the button.

We've found an issue here with the image property - will be fixed in the next beta. Thanks for reporting it!

2 Likes