home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AmigActive 20
/
AACD20.BIN
/
AACD
/
Graphics
/
PerfectPaint
/
rexx
/
general
/
SaveNewIcon.rx
< prev
next >
Wrap
Text File
|
2000-04-09
|
2KB
|
117 lines
/* arexx Script
Save NEwIcon
You need "Inject Brush" from NewIcon V3 Archives in C:
*/
options results
parse ARG Port1 b
ADDRESS value Port1
pp_AvoidRefresh
P=SUBSTR(Port1,15,1)
pp_GetDepth
D=result
IF D=24 then DO
pp_RenderReq 1
IF result=0 then DO
pp_permitRefresh
EXIT
END
END
pp_SetBrush 1
IF D=24 then DO
pp_Render 1 'ram:B1'
END
pp_GetWidthB
w1=result
pp_GetHeightB
h1=result
pp_GetDepthB
d1=result
Bname1='ram:t/B.1.'||P
Bname2='ram:t/B.2.'||P
error=1
ADDRESS COMMAND
if (EXISTS(Bname1))&(EXISTS(Bname2)) THEN error=0
ADDRESS value Port1
if error=1 then DO
pp_Warn 'This*script*requires|two*Brushes'
pp_permitRefresh
EXIT
END
pp_SetBrush 2
IF D=24 then DO
pp_Render 1 'ram:B2'
END
pp_GetWidthB
w2=result
if w1~=w2 THEN DO
pp_Warn 'Brushes*must*have|the*same*width.'
pp_permitRefresh
EXIT
END
pp_GetHeightB
h2=result
if h1~=h2 THEN DO
pp_Warn 'Brushes*must*have|the*same*height.'
pp_permitRefresh
EXIT
END
pp_GetDepthB
d2=result
if d1~=d2 THEN DO
pp_Warn 'Brushes*must*have|the*same*depth.'
pp_permitRefresh
EXIT
END
IF h1>93|w1>93 THEN DO
pp_Warn 'Maximum*icon*size*is|93x93'
pp_permitRefresh
EXIT
END
pp_askfile 'Select*a*.info*file'
file=result
IF RIGHT(file,5)~='.info' THEN DO
file=file||'.info'
END
pp_permitRefresh
ADDRESS COMMAND
if ~EXISTS(file) THEN DO
'COPY >nil: PerfectPaint:Icons/NI.info '||'"'||file||'"'
END
IF D<24 then DO
'C:injectbrush '||' "'||file||'" '||Bname1||' '||Bname2||' FORCE'
END
ELSE DO
'C:injectbrush '||' "'||file||'" '||'ram:B1 ram:B2 FORCE'
ADDRESS COMMAND
'delete >nil: ram:B1'
'delete >nil: ram:B2'
END