home *** CD-ROM | disk | FTP | other *** search
- REM Change colors in PhotoPaint. Creates files in c:\temp
- REM Colorep.csc May 18, 1995
-
- REM This file takes paintbrush .bmps on the CorelDRAW disk, opens them
- REM and changes all of the white colors to red.
- REM it then saves them to your hard disk in RGB format, in the "C:\temp\brushes"
- REM folder. You will want to erase this folder once the macro finishes.
- REM If you run this with PHOTOPAINT visible,
- REM you should be able to see the changes taking place.
- REM This illustrates the power of the macro to perform repeated actions
- REM This macro could be easily altered to convert all of the files in a folder
- REM to a given format, type, etc.
- REM You could use Findfirstfolder to assemble the list of files.
-
- REM Get the drive letter of the CD-ROM
-
- ON ERROR GOTO HANDLER
-
- diskdir = INPUTBOX("Please enter the letter of your CD-ROM drive" + CHR(13) + CHR(10) + "Make sure that the CorelDRAW6 CD#1 disk is in the drive")
- REM This would check to make sure the user entered something.
- IF diskdir = "" THEN
- MESSAGE "You have entered nothing"
- STOP
- END IF
-
- REM remove anything but the drive letter (first character)
- diskdir = LEFT(diskdir, 1)
-
- MKFOLDER "C:\temp\brushes"
- REM Use this array to store the filenames. Could use findfirst, findnext instead of hard-coding
- DIM files(5) AS STRING
- files(1) = "Boxpanel.bmp"
- files(2) = "Clamtext.bmp"
- files(3) = "Footprnt.bmp"
- files(4) = "Fuzzy.bmp"
- files(5) = "Gradient.bmp"
-
- WITHOBJECT PAINT
- FOR i% = 1 TO 5
- FileName$ = diskdir + ":\photopnt\plgbrush\" + files(i)
- .FileOpen FileName$, -1, -1, -1, -1, 0
- FileName$ = "c:\temp\brushes\brush0" + str(i%) + ".bmp"
- .ImageConvert 1,1,0,0,0,0,0
- .SetPaintColor 5, 0, 0, 0, 0
- .SetPaperColor 5, 255, 0, 0, 0
- .ColorReplace
- .FileSave FileName$, 769, 0
- NEXT i%
- END WITHOBJECT
- STOP
-
- HANDLER:
- IF ERRNUM = 302 THEN RESUME NEXT 'if unable to make folder (already exists)
- 'Any other error will go to Script's default error handler
-