Image resize.

Derek Bump webmaster at dreamscapesoftware.com
Tue Oct 19 17:36:32 EDT 2004


> very nice, Derek, very nice!
> 
> Could you eventually consider to give a TINY hint on how to use it?

:)  Yes, sorry about that.  I was composing message when I got a call (I work in Security with the local Police Department) so I just sent it and I'm back now.

That script is for constraining the aspect ratio for an image when a new width or height is choosen.  It would consit of 2 fields, width and height, and 2 option menus both containing "Pixels" and "Percent".  Also, there's a checkbox to turn on/off the aspect calculator.

The original width and height are always constant and held in the variables oWidth and oHeight.  When a new width or height is entered in the fields, the appropriate "doUpdate" handler is called and puts the calculated width and height into the variables and then into the opposite field.

The script is not completely exact though.  Sometimes the numbers are a little off when trying to get a calculation down to 1 or 2 pixels, but it works pretty well.
 

Derek Bump
Dreamscape Software
____________________________________________
Compress Images Easily with JPEGCompress
http://www.dreamscapesoftware.com


More information about the use-livecode mailing list