Putting an image into a field using imagesource

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
glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Putting an image into a field using imagesource

Post by glenn9 » Wed Feb 24, 2021 9:26 am

Hi Everyone,

I feel that this should be simple to accomplish but I guess I'm having a logic failure here... I'm wanting to put an image that is stored in an image control into a field.

I thought this code would do it:

Code: Select all

   ...
   put image"Im" into tIm
   set the imagesource of char 1 of field "txtFIELD" to tIm
   ...
but no!

Grateful if anyone could help in showing me where I'm going wrong!

Many thanks

Glenn

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

Re: Putting an image into a field using imagesource

Post by Klaus » Wed Feb 24, 2021 10:11 am

Hi Glenn,

the DICTIONARY (Nudge, nudge) leaves no doubt about this! 8)

Code: Select all

...
set the imagesource of char 1 of field "txtFIELD" to (the ID of img "lm")
...
# Or
...
set the imagesource of char 1 of field "txtFIELD" to "lm"
...
Best

Klaus

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Putting an image into a field using imagesource

Post by glenn9 » Wed Feb 24, 2021 11:13 am

Thanks Klaus,

all works and I think I now understand!

Glenn

jmburnod
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 2729
Joined: Sat Dec 22, 2007 5:35 pm
Contact:

Re: Putting an image into a field using imagesource

Post by jmburnod » Wed Feb 24, 2021 2:30 pm

Hi,
You may even use external file :D

Code: Select all

set the imageSource of last char of me to "binfile:My Image"
Best regards
Jean-Marc
https://alternatic.ch

glenn9
Posts: 234
Joined: Wed Jan 15, 2020 10:45 pm

Re: Putting an image into a field using imagesource

Post by glenn9 » Wed Feb 24, 2021 4:44 pm

Thanks Jean-Marc, another learning point for me. Regards, Glenn

Post Reply