home *** CD-ROM | disk | FTP | other *** search
/ Global Amiga Experience / globalamigaexperience.iso / compressed / graphic / imagefx20demo.lha / Rexx.lha / Rexx / Border.ifx next >
Text File  |  1994-07-22  |  2KB  |  99 lines

  1. /*
  2.  * $VER: Border 2.0.0 (22.7.94)
  3.  *
  4.  * Arexx program for the ImageFX image processing system.
  5.  * Written by Thomas Krehbiel
  6.  *
  7.  * Revised for ImageFX release 2.0.
  8.  *
  9.  * This program will generate a 3D-looking border around the
  10.  * current image.
  11.  *
  12.  */
  13.  
  14. OPTIONS RESULTS
  15.  
  16. GetMain ; IF result = "" THEN EXIT ; PARSE VAR result name width height depth
  17.  
  18. RequestNumber '"Border Thickness (Pixels):"' 10
  19. IF rc ~= 0 THEN EXIT 0     /* cancelled? */
  20. count = result
  21.  
  22. LockInput
  23.  
  24. SaveUndo ; Undo Off
  25.  
  26. BeginBar 'Border' count
  27. LockGUI
  28.  
  29. Redraw Off
  30.  
  31. step = 255 / (count-3)
  32. grey = step
  33. le = 0
  34. te = 0
  35. wid = width
  36. ht = height
  37.  
  38. DO i = 0 TO count - 3
  39.  
  40.    UnlockGUI
  41.    Bar i
  42.    LockGUI
  43.  
  44.    /* the bright side */
  45.    SetPalette '-1' grey grey grey
  46.    Line le te le+wid-1 te
  47.    Line le te le te+ht-1
  48.  
  49.    /* the dark side */
  50.    SetPalette '-1' grey*2/3 grey*2/3 grey*2/3
  51.    Line le+wid-1 te le+wid-1 te+ht-1
  52.    Line le+wid-1 te+ht-1 le te+ht-1
  53.  
  54.    grey = grey + step
  55.    le = le + 1
  56.    te = te + 1
  57.    wid = wid - 2
  58.    ht = ht - 2
  59.  
  60.    END
  61.  
  62. grey = 255 - step
  63.  
  64. DO WHILE i < count
  65.  
  66.    UnlockGUI
  67.    Bar i
  68.    LockGUI
  69.  
  70.    /* the bright side */
  71.    SetPalette '-1' grey grey grey
  72.    Line le te le+wid-1 te
  73.    Line le te le te+ht-1
  74.  
  75.    /* the dark side */
  76.    SetPalette '-1' grey*2/3 grey*2/3 grey*2/3
  77.    Line le+wid-1 te le+wid-1 te+ht-1
  78.    Line le+wid-1 te+ht-1 le te+ht-1
  79.  
  80.    grey = grey - step
  81.    le = le + 1
  82.    te = te + 1
  83.    wid = wid - 2
  84.    ht = ht - 2
  85.  
  86.    i = i + 1
  87.  
  88.    END
  89.  
  90. UnlockGUI
  91. EndBar
  92.  
  93. Redraw On ; Undo On
  94. Redraw
  95.  
  96. UnlockInput
  97.  
  98. EXIT
  99.