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

  1. /*     arexx Script 
  2.     Scale Anim
  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_GetDepth
  23.     Depth=result    
  24.  
  25.     pp_GetWidthB
  26.     Wb=result
  27.     IsBrush=0
  28.     IF Wb>0 then DO
  29.         IsBrush=1
  30.         pp_Bsave "perfectpaint:Temp/brush" 0 3
  31.     END
  32.  
  33.     X2=Width/2
  34.     Y2=Height/2    
  35.  
  36.     pp_CountFrames
  37.     nb=result
  38.     IsAnim=0
  39.     if nb>1 then do
  40.         pp_SavePrefs 0 1 100 0 0
  41.         IsAnim=1
  42.         IF Depth<24 then DO
  43.             pp_Psave "ram:palette_temp" 0
  44.         END
  45.         Do i=1 to nb
  46.             pp_GotoFrame i
  47.             pp_Save 'PerfectPaint:Temp/Anim'||i 0
  48.             pp_GetJiffies
  49.             J.i=result
  50.         END
  51.         pp_New Width Height Depth
  52.         IF Depth<24 then DO
  53.             pp_Pload "ram:palette_temp"
  54.             ADDRESS COMMAND    'delete >nil: ram:palette_temp'
  55.             ADDRESS value Port
  56.         END                
  57.         pp_MakeAnim nb
  58.         do i=1 to nb
  59.             pp_Bload 'PerfectPaint:Temp/Anim'||i
  60.             pp_ScaleBrush Width Height
  61.             pp_Plot X2 Y2
  62.             pp_SetJiffies i J.i
  63.             pp_NextFrame
  64.         END
  65.         pp_FreeBrush
  66.         IF IsBrush=1 then DO
  67.             pp_Bload "perfectpaint:Temp/brush"
  68.         END        
  69.         pp_PermitRefresh
  70.         ADDRESS COMMAND    'delete >nil: PerfectPaint:Temp/?#.*'
  71.         EXIT
  72.     END
  73.  
  74.