ID:2049763
 
(See the best response by FKI.)
Code:
var
image1 = "flower.png"
winset(usr, "label1", "image = [image1]")


Problem description: I have a variable with the name of the pic I'd like to set to a label, that pic with the name exists in the directory. I can't get to set it with winset though, think it's must be the winset line of code... Any ideas?
Ty
Try the icon macro:

winset(receiver, "label", "image = \icon[image1]")
var
image1=icon('YourIcon.dmi',icon_state="IconState")
winset(src,"default.map1","image=\ref[fcopy_rsc(image1)]\"")
I tested the first but didn't work :|
The second might but I have many, many images and it would take a lot of time making them dmis...
In response to Bassnectar
Best response
You don't have to transform anything into .dmi files.

If what I did doesn't work, Synpax's method should.

winset(receiver, "label", "image = \ref[fcopy_rsc(image1)]")