storing images

mark mitchell cowhead at mac.com
Mon Feb 10 13:27:01 EST 2003


Someone wrote:

"Put image 3 into image 4"

This does not work for me.  I tried both with images pointing to an 
image stored elsewhere (outside of rev) and for images stored in the 
stack.  All I get is a white or gray image.  What am I doing wrong? (Mac 
OS 10.15)

Sannyassin wrote:

> When leaving the card the images are resized to their
> original size so that any subsequent ratio changes for usage in other
> contexts are always working from the known original size

I wouldn't worry or bother about all this.  You can save this and the 
whole custom property hassle with a simple:

on preopenCard
set the height of image Whatever of card whatever of stack 
whateverSubstack to the height of button 1
set the width etc
set the icon of button 1 to image whatever
end preopenCard

If the images are not all the same size or are not all proportional (as 
mine usually aren't) you can resize them proportionally and keep them 
within the limits of the buttons using something like this:

if (the height of image "goat")>(the width of image "goat") then
     put (the height of button "dog")/(the height of image "goat") into 
resizeFactor
   else
     put (the width of button "dog")/(the width of image "goat") into 
resize Factor
   end if
   put (the height of image "goat") * resizeFactor into newHeight
   put (the width of image "goat") * resizeFactor into newWide
   set the height of image "goat" to newHeight
   set the width of image "goat" to newwide


mark mitchell
Japan




More information about the use-livecode mailing list