home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / EDG-CT1.DMS / in.adf / CT.run / Scripts2 / 5 / Magnifying_Glass < prev    next >
Encoding:
Text File  |  1995-10-18  |  2.8 KB  |  140 lines

  1. /*
  2.                         Control Tower Arexx Script
  3.                            Written By J.L. White
  4.                          (C)1995 Merlin's Software
  5. Lines=6
  6. 01=Magnifying Glass
  7. 02= 
  8. 03=This script loads each image of the File List Window
  9. 04=into ImageFX and moves a magnifying glass along a
  10. 05=user defined path and magnifies the image under the
  11. 06=glass part of the magnifying glass.
  12.  
  13. */
  14.  
  15. options results
  16.  
  17. arg FrameNum TotalNum
  18. address "IMAGEFX.1"
  19. ScreenToFront
  20. if FrameNum = 0 then do
  21.     FrameNum = 1
  22.     KillBrush
  23.     call PickLine()
  24.     RequestSlider '"Enter Amount To Magnify!"' 1 100 30
  25.     Answer2 = Result
  26.     call open TempFile,"RAM:CT-IFLB",W
  27.     call writeln TempFile,Answer
  28.     call writeln TempFile,Answer2
  29.     call close TempFile
  30.     end
  31. else do
  32.     call open TempFile,"RAM:CT-IFLB",R
  33.     line = readln(TempFile)
  34.     parse var line X1 Y1 X2 Y2
  35.     line = readln(TempFile)
  36.     parse var line Answer2
  37.     call close TempFile
  38.     end
  39.  
  40. ActiveColor 1
  41. DrawMode Normal
  42. DrawStyle Normal
  43. Pen 0 1
  44. Blend 100
  45. AlphaChannel Off
  46. EdgeMode Normal 0
  47. FillMode Solid 0 0 0 SMOOTH
  48. AirbrushSettings 5 50 0 Spray
  49. call GetXYCords
  50. Buffer2Swap
  51. AlphaChannel Off
  52. ClearBuffer 0 0 0 FORCE
  53. FilledOval X Y 84 72
  54. Buffer2Alpha
  55. Swap
  56. Buffer2Swap
  57. Scissors
  58. FilledOval X Y 84 72
  59. GetBrush
  60. parse var result Name BWidth BHeight Blah
  61. Scale BWidth+Answer2 BHeight+Answer2
  62. BrushHandle BWidth%2 BHeight%2
  63. Point X-(Answer2%2) Y-(Answer2%2)
  64. KillBrush
  65. Swap
  66. EdgeMode Normal
  67. AlphaChannel FRISKET
  68. Merge 100 Alpha
  69. AlphaChannel Off
  70. LoadBrush "CT:Brushes/MagGlass"
  71. BrushHandle 0 0
  72. Blend 75
  73. DrawMode Darken
  74. BrushHandle 0 0
  75. Point (X-162)+6 (Y-86)+6
  76. Blend 100
  77. DrawMode Normal
  78. Point X-162 Y-86
  79. KillBrush
  80. exit
  81.  
  82.  
  83. GetXYCords:
  84.     TotalKey = 1
  85.     NumKey = (TotalNum/TotalKey)
  86.     FirstNum = ((NumKey - (NumKey-(FrameNum-1)))%NumKey)+1
  87.     SecNum = FirstNum+1
  88.     if FirstNum = TotalKey then do
  89.         NumKey = NumKey - 1
  90.         NewNum = (((FrameNum-((FirstNum-1)*NumKey)))-(TotalKey-1))
  91.         end
  92.     else 
  93.         NewNum = ((FrameNum-((FirstNum-1)*NumKey)))
  94.     if X2 < X1 then do
  95.         DiffX = -((X1-X2)/(NumKey))
  96.         end
  97.     else do
  98.         DiffX = ((X2-X1)/(NumKey))
  99.         end
  100.     if Y2 < Y1 then do
  101.         DiffY = -((Y1-Y2)/(NumKey))
  102.         end
  103.     else do
  104.         DiffY = ((Y2-Y1)/(NumKey))
  105.         end
  106.     X = (X1 + (DiffX*NewNum))-DiffX
  107.     Y = (Y1 + (DiffY*NewNum))-DiffY
  108.     X = X % 1
  109.     Y = Y % 1
  110. return
  111.  
  112. PickLine:
  113.     Menu ToolBox
  114.     RequestNotify "Draw Line From Point A To Point B For Movement Of Magnifying Glass!"
  115.     DrawTool Line
  116.     HidePanel
  117.     Undo On
  118.     WaitFor SELECTDOWN
  119.     parse var result X1 Y1
  120.     WaitFor SELECTUP
  121.     parse var result X2 Y2
  122.     Undo
  123.     ShowPanel
  124.     Undo Off
  125.     GetMain
  126.     parse var result Name Width Height Blah
  127.     if X1 < 10 then X1 = -50
  128.     if Y1 < 10 then Y1 = -10
  129.     if X2 > (Width-10) then X2 = Width+100
  130.     if Y2 > (Height-10) then Y2 = Width+10
  131.     X1 = strip(X1)
  132.     Y1 = strip(Y1)
  133.     X2 = strip(X2)
  134.     Y2 = strip(Y2)
  135.     Answer = X1" "Y1" "X2" "Y2
  136.     RequestResponse "Is The Line You Have Drawn Correct?"
  137.     if rc ~= 0 then call PickLine()
  138.  
  139. return
  140.