home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
bridge
/
ScaleWin.rx
< prev
next >
Wrap
Text File
|
2001-03-08
|
3KB
|
193 lines
/* arexx Script
Scale Window
*/
options results
parse ARG Port Width Height Mode b
ADDRESS value Port
pp_AvoidRefresh
pp_AnimGui 1
if result<0 then
do
EXIT
end
pp_GetWidth
W=result
pp_GetHeight
H=result
pp_GetWidthB
Wb=result
IsBrush=0
IF Wb>0 then DO
IsBrush=1
pp_Bsave "perfectpaint:Temp/brush" 0 3
END
pp_GetBpen
Bpen=result
pp_GetDepth
Depth=result
X2=W/2
Y2=H/2
X=Width/2
Y=Height/2
X3=X-X2
Y3=Y-Y2
pp_CountFrames
nb=result
IsAnim=0
if nb>1 then do
pp_SavePrefs 0 1 100 0 0
IsAnim=1
IF Depth<24 then DO
pp_Psave "ram:palette_temp" 0
END
Do i=1 to nb
pp_GotoFrame i
pp_Save 'PerfectPaint:Temp/Anim'||i 0
pp_GetJiffies
J.i=result
END
pp_New Width Height Depth
IF Depth<24 then DO
pp_Pload "ram:palette_temp"
ADDRESS COMMAND 'delete >nil: ram:palette_temp'
ADDRESS value Port
END
pp_SetBpen Bpen
pp_Cls
pp_MakeAnim nb
do i=1 to nb
pp_Bload 'PerfectPaint:Temp/Anim'||i
IF Mode=0 then DO
pp_Plot X2 Y2
END
IF Mode=10 then DO
pp_Plot X Y2
END
IF Mode=20 then DO
pp_Plot X+X3 Y2
END
IF Mode=3 then DO
pp_Plot X2 Y
END
IF Mode=13 then DO
pp_Plot X Y
END
IF Mode=23 then DO
pp_Plot X+X3 Y
END
IF Mode=6 then DO
pp_Plot X2 Y+Y3
END
IF Mode=16 then DO
pp_Plot X Y+Y3
END
IF Mode=26 then DO
pp_Plot X+X3 Y+Y3
END
pp_SetJiffies i J.i
pp_NextFrame
END
pp_FreeBrush
IF IsBrush=1 then DO
pp_Bload "perfectpaint:Temp/brush"
END
pp_PermitRefresh
ADDRESS COMMAND 'delete >nil: PerfectPaint:Temp/?#.*'
EXIT
END
X2=W/2
Y2=H/2
X=Width/2
Y=Height/2
X3=X-X2
Y3=Y-Y2
pp_asay 'Please*wait*...'
pp_PickBrush 0 0 W H
pp_GetWidthB
IF result=0 then DO
pp_CloseAsay
pp_Warn 'Not*enough*memory.'
IF IsBrush=1 then DO
pp_Bload "perfectpaint:Temp/brush"
END
pp_PermitRefresh
ADDRESS COMMAND 'delete >nil: PerfectPaint:Temp/?#.*'
END
pp_New Width Height
pp_CloseAsay
pp_asay 'Please*wait*...'
IF Mode=0 then DO
pp_Plot X2 Y2
END
IF Mode=10 then DO
pp_Plot X Y2
END
IF Mode=20 then DO
pp_Plot X+X3 Y2
END
IF Mode=3 then DO
pp_Plot X2 Y
END
IF Mode=13 then DO
pp_Plot X Y
END
IF Mode=23 then DO
pp_Plot X+X3 Y
END
IF Mode=6 then DO
pp_Plot X2 Y+Y3
END
IF Mode=16 then DO
pp_Plot X Y+Y3
END
IF Mode=26 then DO
pp_Plot X+X3 Y+Y3
END
pp_FreeBrush
pp_CloseAsay
IF IsBrush=1 then DO
pp_Bload "perfectpaint:Temp/brush"
END
pp_PermitRefresh
ADDRESS COMMAND 'delete >nil: PerfectPaint:Temp/?#.*'