insert image file into image area with script

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
lucdrb
Posts: 2
Joined: Wed Mar 07, 2012 8:19 pm

insert image file into image area with script

Post by lucdrb » Wed Mar 07, 2012 8:39 pm

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

sturgis
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 1685
Joined: Sat Feb 28, 2009 11:49 pm

Re: insert image file into image area with script

Post by sturgis » Wed Mar 07, 2012 8:50 pm

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.

Klaus
Posts: 14194
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: insert image file into image area with script

Post by Klaus » Wed Mar 07, 2012 10:47 pm

Hi Luc,

welcome to the forum! :D

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


Best

Klaus

lucdrb
Posts: 2
Joined: Wed Mar 07, 2012 8:19 pm

Re: insert image file into image area with script

Post by lucdrb » Thu Mar 08, 2012 8:07 am

thanks for your replies, it help me to go further

Luc

Post Reply