home *** CD-ROM | disk | FTP | other *** search
- /*
- -----------------------------------------------------------------------------
- This AREXX Script will create an icon for an image, the width, the height
- and the name of the image have to be specified in the argument by the user.
- The Program will load the WBScreen, so it must be present.
- The dither to be used must also be specified in the arguments.
-
- Host address: ADPro (Art Department Professional ®ASDG)
- Written by: Jan Van Overbeke, 3-DEE, ©1993.
- Read the AREXX-Scripti doc for more info about operation and rights!
- -----------------------------------------------------------------------------
- */
-
- parse arg filename iconx icony dthrnr
- if ~exists(filename)|filename='' then do
- say 'Unable to find the image!!!!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- if iconx=0|icony=0|iconx=''|icony='' then do
- say 'Iconsizes not specified! Wrong arguments'
- say 'See Ya.....'
- say ''
- exit
- end
-
- if ~(dthrnr>-1|dthrnr<7) then do
- say 'Invalid dithercode!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- address 'ADPro'
- options results
- say 'Image Icon: Written by JAN VAN OVERBEKE, 3-DEE, ©1993.'
- say 'IMAGE: 'filename
- say 'Icon size: 'iconx'x'icony
- say ''
-
- /* ---- Need to load Workbench first ---- */
- /* ---- To know what colors it has ---- */
- /* ---- and lock its palette ---- */
- /* -------------------------------------- */
- say 'Loading WorkBench....'
- LFORMAT 'SCREEN'
- if RC~=0 then do
- say 'Unable to switch to the SCREEN-Loader!'
- say 'See Ya......'
- say ''
- exit
- end
-
- load 'Workbench Screen'
- if RC~=0 then do
- say 'Unable to load the WorkBench-screen!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- RENDER_TYPE
- colors=ADPRO_RESULT
- if ~(colors=4|colors=2) then say 'It is advisable to only use 2 or 4 Colors!'
-
- PSTATUS 'LOCKED'
- if RC~=0 then do
- say 'Unable to switch the palette to locked!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- say 'Loading....'
- LFORMAT 'UNIVERSAL'
- if RC~=0 then do
- say 'Unable to switch to the UNIVERSAL-Loader!'
- say 'See Ya.......'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- load filename
- if RC~=0 then do
- say 'Unable to load the image!'
- say 'See Ya......'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- say 'Preparing Image...'
- dither dthrnr
- if RC~=0 then do
- say 'Unable to switch to dither number 'dthrnr'!'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- render_type colors
- if RC~=0 then do
- say 'Unable to switch to 'colors'!'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- ABS_SCALE iconx icony
- if RC~=0 then do
- say 'Scale failed!'
- say 'See Ya....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- execute
- if RC~=0 then do
- say 'Execute failed!'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- say 'Saving IconImage....'
- SFORMAT 'IFF'
- if RC~=0 then do
- say 'Unable to switch to the IFF-Saver!'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- save 'ram:IconImage' IMAGE
- if RC~=0 then do
- say 'Error during save dummy-image to ram:'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- if ~exists('c:Brush2Icon') then do
- say 'Could not find the Brush2Icon-program!'
- say 'It should be found in your c: directory.'
- say 'See Ya.....'
- say ''
- PSTATUS 'UNLOCKED'
- exit
- end
-
- address COMMAND 'c:brush2icon ram:iconimage 'filename
- address COMMAND 'delete RAM:IconImage'
-
- PSTATUS 'UNLOCKED'
- if RC~=0 then do
- say 'Unable to switch the palette to unlocked!'
- say 'See Ya.....'
- say ''
- exit
- end
-
- dither 0
- if RC~=0 then do
- say 'Unable to switch the dither to 0 !'
- say 'See Ya....'
- say ''
- exit
- end
-
- say 'Done.'
- say ''
- exit
-