Page 1 of 1

link 2 images via Ids?

Posted: Sun Jun 19, 2011 5:17 pm
by Tomka
Hi there,

In LC its possible to link a button with an image imported as control:

Code: Select all

 set icon of btn "b1" to 1117  //1117=id of the image
What I´m looking for is a way to link 2 images on a similiar way. That means that the source of a imagefield shouldnt be a file but a second image (refered by ID or name).

Is there a way to do so? Only found "filename"-property in the dictionary :(

best
Thomas

Re: link 2 images via Ids?

Posted: Sun Jun 19, 2011 5:20 pm
by Klaus
Hi Tomka,
That means that the source of a imagefield shouldnt be a file but a second image refered by ID or name.
sorry, don't understand a word!?

Re: link 2 images via Ids?

Posted: Sun Jun 19, 2011 5:29 pm
by Tomka
@Klaus:

Ich schreib mal deutsch, weil ich das in Englisch nicht hinkriege.

Einem Image kann ich ja ein neues File zuordnen, dann ändert sich das Bild. Aber kann ich auch einem Bild "i1" als Quelle ein anderes Bild "i2" anstatt eines Files zuordnen?

Bei Buttons geht sowas ähnliches, wie ich es es meine, bei den Iconen:

set icon of btn "b1" to <id>


Besser erklärt? :)

Re: link 2 images via Ids?

Posted: Sun Jun 19, 2011 6:32 pm
by Klaus
Hi Tom,

AHA! I think I got it! :D

OK, so you don't want to change the filenname but put an image into another one.

Well, check this:
...
## Just in case:
set the lockloc of img "i1" to false
put img "i5" into img "i1"
## where image "i5" is of course an imported image and not a referenced image!

## this also works, but is much less intuitive...
set the text of img "i1" to the text of img "i5"
## THE TEXT OF AN IMAGE, HA! :D
...
Isn't it amazing? 8)


Best

Klaus