View smaller.

Ryno swartart at iafrica.com
Mon Apr 10 13:26:16 EDT 2006


Thanks for the great script, Malte,

It does a very nice zoom of the window, but I am looking for something more ambitious. I am, to misquote Dan, "an enthusiastic amateur" (an artist), and I need direct guidance, so do not worry about making things too simple.

Try this. New stack. Add button "Smaller" (using your script) and a second button "Bigger". Import an image. Use the "select rectangle" tool to select and move a section of the image. This all works perfectly, but...

The altered image is now a half size image. Enlarging it by adapting your script produces marked pixelation (a very nice effect in itself! but not what I am looking for).

What I need is for editing in the half-size image somehow to be executed onto the original full-sized image, just like an image editor. Can this be done? Maybe by storing the original image in a substack while the visible editing is done on the small image, and then having the editing mirrored onto the original? Excuse the baby steps! Please feel free to contact me off-list if it is more convenient.

Ryno.
http://artistvision.org

> this is not completely thought through, but it helps to get you 
> started. Ideally you store original dimensions in a custom property and 
> use that. Also there might be cases where this fails (groups with 
> lockLoc set to true) that need special treatment...
> If you use many controls it might be slow. A list with all resizeable 
> components and a repeat for each loop might be better then.
>
> All that saied here is a script. For 25 % view use /4 instead of /2. 
> Note that this only makes it smaller, not bigger yet. If you need more, 
> please let me know.
> on mouseUp
> -- 50 % view
>    lock screen
>    repeat with i=1 to the number of controls
>      put the top of control i into tTop
>      put the left of control i into tLeft
>      set the width of control i to the width of control i/2
>      set the height of control i to the height of control i/2
>      set the top of control i to tTop/2
>      set the left of control i to tLeft/2
>    end repeat
>    put the topleft of this stack into tTopLeft
>    set the width of this stack to the width of this stack/2
>    set the height of this stack to the height of this stack /2
>    set the topleft of this stack to tTopLeft
>    unlock screen
> end mouseUp




More information about the use-livecode mailing list