Page 1 of 1

insert image file into image area with script

Posted: Wed Mar 07, 2012 8:39 pm
by lucdrb
Hi,

Complete new in livecode,
I would like to put a image (jpeg) from one directory of my computer into an image area with the mouseup.
I've used
answer file to select the image_file
I know the the path of the selected file is in the it variable
witch is the next instruction to put the selected image file into the image area

Thanks in advance for your answer?

Luc

Re: insert image file into image area with script

Posted: Wed Mar 07, 2012 8:50 pm
by sturgis
Theres a couple ways. If you want to reference the image you can

Edit: This way is only a file reference. If you "put the text of image "imagename" it should be empty.
set the filename of image "imagename" to "c:/myPath/To/Image.jpg"

If you want to shove the data directly into the image you can do something like
Edit: This actually brings the data into the stack. If you "put the text of image "imagename" it will show a representation of the data.
put URL ("binfile:c:/myPath/To/image.jpg") into image "imagename"

I'm sure there are other ways but hopefully this will get you started.

Re: insert image file into image area with script

Posted: Wed Mar 07, 2012 10:47 pm
by Klaus
Hi Luc,

welcome to the forum! :D

Please check these great learning resources:
http://www.runrev.com/developers/lesson ... nferences/


Best

Klaus

Re: insert image file into image area with script

Posted: Thu Mar 08, 2012 8:07 am
by lucdrb
thanks for your replies, it help me to go further

Luc