Rotating Images without enlarging the image space

Ben Rubinstein benr_mc at cogapp.com
Wed Feb 5 07:53:01 EST 2003


> Does anyone know how to rotate an image by 90 degrees without creating
> a larger image?  I need to rotate clock or anti-clockwise by a straight
> 90 degrees.  Problem is, all rotations seem to enlarge to the square of
> the largest side.  Save moving the data pixel-by-pixel using a
> Transcript matrix transform (slowish) is there another way?  I don't
> fancy lots of imagedata manipulation... I'm sure there is a simple way.
> Currently I'm rotating, grouping and resizing group (brings corners
> in).  Not good.

Unfortunately there isn't, AFAIK, an option to rotate without enlarge; the
only solution I have found is to rotate then crop.  Using the built-in
rotate, and then 'manually' (ie in a transcript function) cropping, is still
much quicker than writing your own rorate code (at least, with my attempt!).
Depending on your needs, you can write your own crop routine now (remember -
using 'repeat for each', although more clumsy, is _much_ faster than 'repeat
with'); or wait for Rev 2.0 which has a crop command built in.

 
  Ben Rubinstein               |  Email: benr_mc at cogapp.com
  Cognitive Applications Ltd   |  Phone: +44 (0)1273-821600
  http://www.cogapp.com        |  Fax  : +44 (0)1273-728866





More information about the use-livecode mailing list