Storing images

Scott Rossi scott at tactilemedia.com
Tue Feb 4 15:22:00 EST 2003


Recently, "miscdas at boxfrog.com"  wrote:

>> There is no duplication of the image graphic when you do this; Rev just
>> inserts a temporary copy of the image into RAM just as addcolor does when
>> it draws the image to screen.

> Is a copy of the image placed into RAM, or is there just a pointer created
> that points to the RAM address of a single copy of the image?

Only one copy of an image is created; images are not duplicated unless you
physically create a duplicate image object.  And, any image displayed in
Rev/MC can "pointed to" by another image or button:

images = set the imageData of img image1 to the imageData of img image2

buttons = set the icon of btn button1 to the id of img image2

Also, keep in mind that your entire stack is loaded into RAM at startup, so
any images present in the stack will be loaded, regardless of they are
invisible, positioned off screen, or located in a substack.

If you want to conserve a tiny bit in terms of RAM, there is the
bufferHiddenImages property that you can play with, but you could see a
tradeoff in the time needed to decompress/display the image (see the docs
for more info).  Personally I'd rather have a little extra load time up
front and have everything available immediately, but the developers of
Rev/MC have given us the options to do what we want.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com




More information about the use-livecode mailing list