home *** CD-ROM | disk | FTP | other *** search
/ Graphics 16,000 / graphics-16000.iso / amiga / opalvisn / dropshdw.lha / DropShadow.oprx < prev    next >
Text File  |  1993-04-29  |  2KB  |  107 lines

  1. /* Automatic brush drop shadow creator for OpalPaint.
  2.    AREXX script by Greg Nies, Centaur Development.
  3.  */
  4.  
  5. address 'OpalPaint_Rexx'
  6.  
  7. options Results
  8.  
  9. SaveSetUp
  10. Panic
  11.  
  12. AskBool "Drop Shadow Maker v1.0 - by Greg Niles\nClick OK to continue, Cancel to Abort."
  13. If Result = 0 then EXIT
  14.  
  15. /* Ask which brush to use */
  16. AskInt 1 3 1 "Select brush number (1-3).\n(Select CANCEL if you don't want to lose your brush!)"
  17. If RC = 5 then EXIT
  18. BrushBay = Result
  19.  
  20. /* Get size of selected brush */
  21. ActiveBrush BrushBay
  22. BrushSize
  23. parse var result BWidth BHeight
  24.  
  25. /* Get feather amount from user */
  26. AskInt 0 640 0 "Enter feather amount (0=no feathering).\nThis determines the 'fuzziness' of your drop shadow, in pixels."
  27. If RC = 5 then EXIT
  28. FeatherAmt = Result
  29.  
  30. /* Get transparency level from user */
  31. AskProp 0 100 50 "Select transparency level of drop shadow."
  32. If RC = 5 then EXIT
  33. TransAmt = Result
  34.  
  35. /* Make a new screen */
  36. CurrPage
  37. OrigPage = Result
  38. PageRes
  39. AddPage 640 400 Result
  40. OpenPages
  41. NewPage = Result
  42. PickPage NewPage
  43.  
  44. /* Place brush in center of new screen & in alpha channel */
  45. PageSize
  46. parse var result PageWidth PageHeight
  47. XPosition = Trunc((PageWidth/2)-(BWidth/2))
  48. YPosition = Trunc((PageHeight/2)-(BHeight/2))
  49. ActiveBrush BrushBay
  50. Handle 0 0
  51. ColorSource Multicolor
  52. PutBrush XPosition YPosition
  53. WorkMode ALPHA
  54. SetDrawMode 4
  55. Zap
  56. SetDrawMode 1
  57. ActiveBrush BrushBay
  58. Handle 0 0
  59. ColorSource PaintPot 
  60. ActivePot 1
  61. PutBrush XPosition YPosition
  62. WorkMode Image
  63.  
  64. /* Feather the brush */
  65. ActiveBrush BrushBay
  66. Feather FeatherAmt
  67.  
  68. /* Ask for position of drop shadow */
  69. Okay "Choose the location of your drop shadow."
  70. GetPoint
  71. parse var result XDropPos YDropPos
  72.  
  73. /* Let's do it! */
  74. Busy
  75. WorkMode Alpha        /* Paste drop shadow into alpha channel */
  76. Panic
  77. SetDrawMode 1
  78. ActiveBrush BrushBay
  79. Handle 0 0
  80. ColorSource PaintPot
  81. TransType Standard TransAmt
  82. Trans Enable
  83. ActivePot 1
  84. PutBrush XDropPos YDropPos
  85. Trans Disable
  86.  
  87. /* Calculate size of area to contain brush & drop shadow */
  88. X1 = MIN(XPosition,XDropPos)
  89. Y1 = MIN(YPosition,YDropPos)
  90. X2 = MAX(XPosition+BWidth,XDropPos+BWidth)
  91. Y2 = MAX(YPosition+BHeight,YDropPos+BHeight)
  92.  
  93. /* Cut brush with alpha drop shadow */
  94. WorkMode Image
  95. ActiveBrush BrushBay
  96. CutMode Normal 1
  97. RectCut X1 Y1 X2 Y2
  98.  
  99. /* Go back to old page */
  100. PickPage OrigPage
  101.  
  102. Okay "We're done!  Paste your new brush anywhere you want!"
  103.  
  104. RestoreSetUp
  105. NotBusy
  106. EXIT
  107.