Stored images

J. Landman Gay jacque at hyperactivesw.com
Mon Feb 10 12:50:01 EST 2003


Jim Hurley <jhurley at infostations.com> wrote:

> And just so all this info is in one place I will repeat the primary 
> utility used in the stack script of the substack
> 
> on resizeImage theImage,theRatio
>    --Reset the image size on the substack card to the desired size
>    set the defaultStack to "imagesSubstack"
>    put the imageSize of image theImage into theImageSize
>    set the width of image theImage to theRatio*item 1 of theImageSize
>    set the height of image theImage to theRatio* item 2 of theImageSize

Actually, it isn't even necessary to store the original image size in a 
custom property. Rev will automatically save the size so that the script 
doesn't have to track it. The formattedwidth and formattedheight of the 
image retain the original dimensions. You can use those properties to 
get the original size, and toss out a few lines of extra scripting besides:

set the width of image theImage to theRatio*the formattedWidth of img 
theImage
set the height of image theImage to theRatio*the formattedHeight of img 
theImage

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com




More information about the use-livecode mailing list