home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 20 / AACD20.BIN / AACD / Graphics / PerfectPaint / rexx / bridge / ScaleWin.rx < prev    next >
Text File  |  2001-03-08  |  3KB  |  193 lines

  1. /*     arexx Script 
  2.     Scale Window
  3. */
  4.  
  5.     options results
  6.     parse ARG Port Width Height Mode b
  7.     
  8.     ADDRESS value Port
  9.     pp_AvoidRefresh
  10.  
  11.     pp_AnimGui 1
  12.     if result<0 then
  13.         do
  14.             EXIT
  15.         end
  16.  
  17.     pp_GetWidth
  18.     W=result
  19.     pp_GetHeight
  20.     H=result
  21.  
  22.     pp_GetWidthB
  23.     Wb=result
  24.     IsBrush=0
  25.     IF Wb>0 then DO
  26.         IsBrush=1
  27.         pp_Bsave "perfectpaint:Temp/brush" 0 3
  28.     END
  29.  
  30.     pp_GetBpen
  31.     Bpen=result
  32.     pp_GetDepth
  33.     Depth=result    
  34.  
  35.     X2=W/2
  36.     Y2=H/2    
  37.     X=Width/2
  38.     Y=Height/2
  39.     X3=X-X2
  40.     Y3=Y-Y2
  41.  
  42.     pp_CountFrames
  43.     nb=result
  44.     IsAnim=0
  45.     if nb>1 then do
  46.         pp_SavePrefs 0 1 100 0 0
  47.         IsAnim=1
  48.         IF Depth<24 then DO
  49.             pp_Psave "ram:palette_temp" 0
  50.         END
  51.         Do i=1 to nb
  52.             pp_GotoFrame i
  53.             pp_Save 'PerfectPaint:Temp/Anim'||i 0
  54.             pp_GetJiffies
  55.             J.i=result
  56.         END
  57.         pp_New Width Height Depth
  58.         IF Depth<24 then DO
  59.             pp_Pload "ram:palette_temp"
  60.             ADDRESS COMMAND    'delete >nil: ram:palette_temp'
  61.             ADDRESS value Port
  62.         END                
  63.         pp_SetBpen Bpen
  64.         pp_Cls
  65.         pp_MakeAnim nb
  66.         do i=1 to nb
  67.             pp_Bload 'PerfectPaint:Temp/Anim'||i
  68.  
  69.             IF Mode=0 then DO
  70.                 pp_Plot X2 Y2
  71.             END
  72.  
  73.             IF Mode=10 then DO
  74.                 pp_Plot X Y2
  75.             END    
  76.  
  77.             IF Mode=20 then DO
  78.                 pp_Plot X+X3 Y2
  79.             END
  80.  
  81.             IF Mode=3 then DO
  82.                 pp_Plot X2 Y
  83.             END
  84.  
  85.             IF Mode=13 then DO
  86.                 pp_Plot X Y
  87.             END
  88.  
  89.             IF Mode=23 then DO
  90.                 pp_Plot X+X3 Y
  91.             END
  92.  
  93.             IF Mode=6 then DO
  94.                 pp_Plot X2 Y+Y3
  95.             END
  96.  
  97.             IF Mode=16 then DO
  98.                 pp_Plot X Y+Y3
  99.             END
  100.  
  101.             IF Mode=26 then DO
  102.                 pp_Plot X+X3 Y+Y3
  103.             END
  104.         
  105.             pp_SetJiffies i J.i
  106.             pp_NextFrame
  107.  
  108.         END
  109.         pp_FreeBrush
  110.         IF IsBrush=1 then DO
  111.             pp_Bload "perfectpaint:Temp/brush"
  112.         END        
  113.         pp_PermitRefresh
  114.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  115.         EXIT
  116.     END
  117.  
  118.     X2=W/2
  119.     Y2=H/2    
  120.     X=Width/2
  121.     Y=Height/2
  122.     X3=X-X2
  123.     Y3=Y-Y2
  124.     
  125.     pp_asay 'Please*wait*...'        
  126.     pp_PickBrush 0 0 W H
  127.  
  128.     pp_GetWidthB
  129.     IF result=0 then DO
  130.         pp_CloseAsay
  131.         pp_Warn 'Not*enough*memory.'        
  132.         IF IsBrush=1 then DO
  133.             pp_Bload "perfectpaint:Temp/brush"
  134.         END        
  135.         pp_PermitRefresh
  136.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  137.     END    
  138.  
  139.     pp_New Width Height
  140.     pp_CloseAsay
  141.  
  142.     pp_asay 'Please*wait*...'
  143.  
  144.     IF Mode=0 then DO
  145.         pp_Plot X2 Y2
  146.     END
  147.  
  148.     IF Mode=10 then DO
  149.         pp_Plot X Y2
  150.     END    
  151.  
  152.     IF Mode=20 then DO
  153.         pp_Plot X+X3 Y2
  154.     END
  155.  
  156.     IF Mode=3 then DO
  157.         pp_Plot X2 Y
  158.     END
  159.  
  160.     IF Mode=13 then DO
  161.         pp_Plot X Y
  162.     END
  163.  
  164.     IF Mode=23 then DO
  165.         pp_Plot X+X3 Y
  166.     END
  167.  
  168.     IF Mode=6 then DO
  169.         pp_Plot X2 Y+Y3
  170.     END
  171.  
  172.     IF Mode=16 then DO
  173.         pp_Plot X Y+Y3
  174.     END
  175.  
  176.     IF Mode=26 then DO
  177.         pp_Plot X+X3 Y+Y3
  178.     END
  179.  
  180.     pp_FreeBrush
  181.     pp_CloseAsay    
  182.  
  183.     IF IsBrush=1 then DO
  184.         pp_Bload "perfectpaint:Temp/brush"
  185.     END
  186.  
  187.     pp_PermitRefresh
  188.     ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  189.  
  190.     
  191.  
  192.  
  193.