Zoom Image Widgets Anyone

Sivakatirswami katir at hindu.org
Wed Dec 8 18:14:37 EST 2010


  I'm sitting here making my own zoom tool when I start thinking 
someelse *must*have done this an a lot better than me.

I have an image with this script

on mousedown
     grab me
end mousedown

and a slider with this script....

where the gWidth and gHeight are the size of the image after import...

Now the original images are over 3000 pixels wide and 300 DPI..

I need to the user to be able to really zoom in and get a good quality 
view of small characters

This works, but I would like to keep the relative position but of course 
I am losing this by resetting the topleft to 0,0 each time.

years ago I though there was a widget right in the IDE that was a zoom 
tool and you could clone this for your own work...

ideally you the user has the normal experience of switching to a zoom 
tool dragging and focusing in on he area of choice..

Can you share?

Thanks
skts
------

global gWidth,gHeight
on mouseup
    lock screen
        set the resizequality of image "displayPage" to "best"

       put (the thumbposition of me) /100 into pPercent
       set the rect of image "displayPage" to 
scaleImageByPercent(gWidth, gHeight, pPercent)
end mouseup

function scaleImageByPercent pWidth, pHeight, pPercent
    return (0,0,(pWidth*pPercent),(pHeight*pPercent))
end scaleImageByPercent







More information about the Use-livecode mailing list