/*
 * $VER: Shrink 1.00.00 (24.9.92)
 *
 * Arexx program for the ImageFX image processing system.
 * Written by Thomas Krehbiel
 *
 * Write out a 20 frame sequence consisting of shrinking the
 * current image buffer.
 *
 */

OPTIONS RESULTS

GetMain ; IF result = "" THEN EXIT
PARSE VAR result name width height depth

RequestFile '"Output basename..."'
IF rc ~= 0 THEN EXIT
output = result

CopyToSwap ; Swap

BeginBar 'Shrink' ; LockGui ; Redraw Off

DO i = 1 TO 20

   Message 'Frame' i

   SaveBufferAs ILBM output||RIGHT(i,3,'0')
   Swap

   Scissors
   Box 0 0 width height

   Scale Fast Percent 100-i*3 100-i*3

   Swap
   CreateBuffer width height Grey Force
   ClearBuffer Force 130 130 130

   GetBrush ; IF result = "" THEN EXIT
   PARSE VAR result bwidth bheight bdepth

   Point width%2 height%2
   KillBrush ; UnlockGui ; Redraw ; LockGui

   END

Redraw On ; UnlockGui ; EndBar

EXIT
