Page 1 of 1

Putting an image into a field using imagesource

Posted: Wed Feb 24, 2021 9:26 am
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

Re: Putting an image into a field using imagesource

Posted: Wed Feb 24, 2021 10:11 am
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

Re: Putting an image into a field using imagesource

Posted: Wed Feb 24, 2021 11:13 am
by glenn9
Thanks Klaus,

all works and I think I now understand!

Glenn

Re: Putting an image into a field using imagesource

Posted: Wed Feb 24, 2021 2:30 pm
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

Re: Putting an image into a field using imagesource

Posted: Wed Feb 24, 2021 4:44 pm
by glenn9
Thanks Jean-Marc, another learning point for me. Regards, Glenn