Proportional Scaling of non-EPS images in RR ?

Mark Smith mark at
Tue Sep 18 13:15:17 EDT 2007

Richmond, this should work, I think:

on scalePic pImg
   put min(the height of this stack / the height of pImg, the width  
of this stack / the width of img pImg) into tFactor
   set the height of img pImg to the height of img pImg * tFactor
   set the width of img pImg to the width of img pImg * tFactor
   set the top of img pImg to 0
   set the left of img pImg to 0
end scalePic



On 18 Sep 2007, at 17:51, Richmond Mathewson wrote:

> If I import a JPG, PNG, GIF or other image into a
> stack and it is larger than the card there seems to be
> no way that I can shrink it to fit as the SCALE
> command does with EPS or QT imports:
> for instance:
> set the scale of img "RUBBISH.jpg" to 2
> does nothing
> Now, it is possible to scale non EPS images, but it
> means mucking around mathematically:
> if the width of img "RUBBISH.jpg">400 then
> put the height of img "RUBBISH.jpg" into HITE
> put the width of img "RUBBISH.jpg" into WIDF
> put (WIDF/400) into FAKTOR
> set the width of img "RUBBISH.jpg" to 400
> set the height of img "RUBBISH.jpg" to (HITE/FAKTOR)
> end if
> of course, if the height of img "RUBBISH.jpg" is still
> outwith the boundaries of your stack you have to "do
> it all over again".
> What would be jolly nice (!) would be something that
> would allow one to determine the "shrinkage factor"
> required, and shrink the image.
> sincerely, Richmond Mathewson
> ____________________________________________________________
> A Thorn in the flesh is better than a failed Systems Development  
> Life Cycle.
> ____________________________________________________________
>       ___________________________________________________________
> Want ideas for reducing your carbon footprint? Visit Yahoo! For  
> Good
> _______________________________________________
> use-revolution mailing list
> use-revolution at
> Please visit this url to subscribe, unsubscribe and manage your  
> subscription preferences:

More information about the use-livecode mailing list