How to Set the Image of an Image Control

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
McJazz
Posts: 111
Joined: Sun Apr 04, 2010 5:59 am

How to Set the Image of an Image Control

Post by McJazz » Sun May 01, 2011 6:48 pm

Can you copy the image of an existing image control into another image control using code? I tried setting the ImageData, but the result was garbled.

Thanks

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4163
Joined: Sun Jan 07, 2007 9:12 pm

Re: How to Set the Image of an Image Control

Post by bn » Sun May 01, 2011 8:14 pm

Hi McJazz,

Code: Select all

put image 1 into image 2
or less obvious

Code: Select all

set the text of image 2 to the text of image 1
If you use imageData the dimensions of image object 1 and 2 have to be exactly the same, then it works. Above will adapt the image size.

Kind regards

Bernd

McJazz
Posts: 111
Joined: Sun Apr 04, 2010 5:59 am

Re: How to Set the Image of an Image Control

Post by McJazz » Sun May 01, 2011 8:48 pm

Thanks. I thought it should be simple. It worked once I added ID to the image number.

Post Reply