home *** CD-ROM | disk | FTP | other *** search
/ Windows 95 v2.4 Fix / W95-v2.4fix.iso / COREL6 / PHOTOPNT / COLOREP.CSC < prev    next >
Encoding:
Text File  |  1995-08-12  |  1.9 KB  |  55 lines

  1. REM Change colors in PhotoPaint. Creates files in c:\temp
  2. REM Colorep.csc May 18, 1995
  3.  
  4. REM This file takes paintbrush .bmps on the CorelDRAW disk, opens them
  5. REM and changes all of the white colors to red.
  6. REM it then saves them to your hard disk in RGB format, in the "C:\temp\brushes"
  7. REM folder. You will want to erase this folder once the macro finishes.
  8. REM If you run this with PHOTOPAINT visible,
  9. REM you should be able to see the changes taking place.
  10. REM This illustrates the power of the macro to perform repeated actions
  11. REM This macro could be easily altered to convert all of the files in a folder
  12. REM to a given format, type, etc.
  13. REM You could use Findfirstfolder to assemble the list of files.
  14.  
  15. REM Get the drive letter of the CD-ROM
  16.  
  17. ON ERROR GOTO HANDLER
  18.  
  19. 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")
  20. REM This would check to make sure the user entered something.
  21. IF diskdir = "" THEN 
  22.     MESSAGE "You have entered nothing"     
  23.     STOP
  24. END IF
  25.  
  26. REM remove anything but the drive letter (first character)
  27. diskdir = LEFT(diskdir, 1)
  28.  
  29. MKFOLDER "C:\temp\brushes"
  30. REM Use this array to store the filenames. Could use findfirst, findnext instead of hard-coding
  31. DIM files(5) AS STRING
  32. files(1) = "Boxpanel.bmp"
  33. files(2) = "Clamtext.bmp"
  34. files(3) = "Footprnt.bmp"
  35. files(4) = "Fuzzy.bmp"
  36. files(5) = "Gradient.bmp"
  37.  
  38. WITHOBJECT PAINT
  39.     FOR i% = 1 TO 5
  40.         FileName$ = diskdir + ":\photopnt\plgbrush\" + files(i)
  41.         .FileOpen FileName$, -1, -1, -1, -1, 0
  42.         FileName$ = "c:\temp\brushes\brush0" + str(i%) + ".bmp"
  43.         .ImageConvert 1,1,0,0,0,0,0
  44.         .SetPaintColor 5, 0, 0, 0, 0
  45.         .SetPaperColor 5, 255, 0, 0, 0
  46.         .ColorReplace
  47.         .FileSave FileName$, 769, 0
  48.     NEXT i%
  49. END WITHOBJECT
  50. STOP
  51.  
  52. HANDLER:
  53.     IF ERRNUM = 302 THEN RESUME NEXT    'if unable to make folder (already exists)
  54.                                 'Any other error will go to Script's default error handler
  55.