Storing images

Björnke von Gierke bvg at mac.com
Wed Feb 5 12:47:01 EST 2003


This thread confuses me, so I made some experiments, to clarify all 
this for me, I will list the results of them here (if this is useful 
for any of you then that is your own fault!):

setting the icon:
set the icon of button "foo" to image "bar"

this will reference  the exact same picture (same size) from the image 
to the button.
You cannot set the icon of an image (they do not have any).

setting imagedate:
set the imagedata image "foo" to the imagedata of image "bar"

you should not do this, when the two images have a diffrent size. That 
will result in garbage. If they are the same size then this will copy 
the image. the image"foo" will contain the image directly, no matter if 
image "bar" was referenced, original or only shows a file from the hard 
disk.
Buttons do not have imagedata, so you cant do that with them.

put into:
put image "foo" into image "bar"

This will empty (grey) the image "bar", when the original image is a 
referenced image (contains something in the "filepath").
If the Image "foo" is an imported image, or a reference to another 
image within the stack, then this will copy the image. Thus, when you 
delete the image "foo" then image "bar" will remain unchanged. If the 
lockLoc of "bar" is true, then the image will scale to the size of 
"bar", otherwise it will resize to the size of the original image.

set filename:
set the filename of image "foo" to the filename of image "bar"
set the filename of image "foo" to "binfile:foo/bar/foobar"
set the filename of image "foo" to "http://foo/bar/foobar"
set the filename of image "foo" to "foo/bar/foobar"

this will copy/generate the reference to a file on the hard disk to 
image "foo". If the file on the hard disk gets removed, then the  image 
will show nothing (grey) when loaded next time (eg "go card"). If image 
"bar" is set to a certain size and the lockLoc property is true, then 
the image will scale to that size, otherwise it will resize to the size 
of the original file on the hard disk.

import:
import paint from file "foo/bar/foobar"

This will generate a new Image-Object, containing the image directly, 
instead of a reference to a file on the hard disk.




I found no way to reference a image-object to another imageobject, 
similar to what you can do with the icon of buttons. This is probably 
also the problem over which Jim Hurley stumbled, as you cannot resize 
the referenced icon of a button, whereas you can resize a Image whit a 
filepath.
Please answer with other ways of referencing/copying images so I can 
make a list and pin it next to my Screen.

thank you
Bjoernke




More information about the use-livecode mailing list