Magnifier (script!)

wouter wouter.abraham at pi.be
Mon Jul 21 12:34:03 EDT 2003


Hi all,

> From: Yves COPPE
> Subject: Re: Magnifier (script!)
> Date: Mon, 21 Jul 2003 00:51:14 -0700
>
> Le lundi, 21 juil 2003, à 06:36 Europe/Brussels, Sannyasin   
> Sivakatirswami a écrit :
>
>
> does this work for you?  (zooms in 10 pixel increments)
>
>  local tSizeChange
>
>
> on mouseup
>   if optionkey()="Down" then
>     put (-10) into tSizeChange
>     changeSize
>     exit mouseup
>   end if
>   put (+10) into tSizeChange
>   changeSize
> end mouseup
>
>
> on changeSize
>    put (the height of the target/the width of the target) into tRatio
>     set the width of  the target to (the width of me +tSizeChange)
>     set the height of  the target to (the width of the target * tRatio)
>     set the loc of the target to the mouseloc
>   end changeSize

To optimize the speed in the changeSize routine consider setting the  
rect at once as explained in "Fwd: Shrink Image quickly"  at
	http://lists.runrev.com/pipermail/use-revolution/2003-January/ 
011426.html
(This also can be done by setting the icon of a button (of the desired  
demensions) to the id of the image and setting the rect of the image to  
the rect of the button.)

>
>  Hi Sannyasin, Ken and others,
>
>  We are very close to a solution but there still remains a problem :
>
>  I'd like that the RECT of the target stays at  "30,20,330,220" with  
> the  zoomed image in that rect.
>
>  Can you provide for that ?

There are several solutions depending on which part of the image you  
want to show if  after the resizing the rect of the resulting image is  
larger than the above rect.
  If this is not the case then there is no problem.

>
>  Many thanks.
>
>
>
> Greetings.
> Yves COPPE

  Greetings,
WA








More information about the use-livecode mailing list