Text of an image

Trevor DeVore lists at mangomultimedia.com
Thu Sep 4 09:20:26 EDT 2008


On Sep 4, 2008, at 1:11 AM, J. Landman Gay wrote:

> What's the difference between the text of an image and its  
> imageData? Does text include the alphadata?

If you 'put' the contents of an image file into an image control or  
set the imageData of an image control then the 'text' property  
contains the actual contents of the image file. An example:

put URL ("binfile:/Path/To/file.png") into img 1

For a PNG file or if you set the imageData that data would be in PNG  
format. This means you can recreate a PNG (or JPEG, etc.) file on disk:

put the text of img 1 into URL ("binfile:/Path/To/file2.png")

If you set the filename of an image, however, the 'text' of the image  
will return empty.

The imageData is a standardized means of representing the image in an  
image control. You know that it has 4 bytes per pixel and all pixels  
are represented. This makes it an easier format to create on the fly  
when creating image patterns, etc. For those not familiar with working  
with imageData take a look at the following lesson. It shows how to  
use imageData to create alternating line colors in a field:

<http://revolution.screenstepslive.com/lessons/822-Alternating-Line-Colors-in-a-List-Field 
 >

In answer to your question about 'text' and 'alphadata', no, the  
'text' of an image does not contain the 'alphadata' image control  
property. It can contain the alpha data as represented in the PNG  
format however.

Regards,

-- 
Trevor DeVore
Blue Mango Learning Systems
ScreenSteps: http://www.screensteps.com
Developer Resources: http://revolution.bluemangolearning.com



More information about the use-livecode mailing list