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: Klaus, FourthWorld, heatherlaine, 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 »

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: 14325
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: Putting an image into a field using imagesource

Post by Klaus »

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 »

Thanks Klaus,

all works and I think I now understand!

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

Re: Putting an image into a field using imagesource

Post by jmburnod »

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 »

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