home *** CD-ROM | disk | FTP | other *** search
- REM Converts bmps to 16 color
- REM To16bmp.csc July 24, 1995
-
- REM This file will open all of the bitmaps in a directory and resave them as 16 color bitmaps
- REM These new files will be named *.16
-
- DECLARE SUB convertimage(filename$)
-
- REM Get the Directory from the user
- dir$ = INPUTBOX("Please enter the path to the directory (ie. C:\myimages)" + CHR(13) + CHR(10) + "of the bitmaps you wish to convert")
- IF dir$ = "" THEN STOP
-
- REM Remove the backslash of there is one.
- IF RIGHT(dir$, 1) = "\" THEN dir$ = LEFT(dir$, LEN(dir$) -1)
-
- CURRFOLDER = dir$
-
- REM Get the path to each file
- bmpfile$ = CURRFOLDER + "\" + FINDFIRSTFOLDER("*.bmp", 1 OR 2 OR 4 OR 8 OR 16 OR 32)
- DO WHILE bmpfile <> CURRFOLDER + "\"
- ConvertImage bmpfile 'Convert image actually executes the Paint commands
- bmpfile = CURRFOLDER + "\" + FINDNEXTFOLDER()
- LOOP
-
- REM This is called for each file to be converted
- SUB ConvertImage(filename$)
- WITHOBJECT PAINT
- .FileOpen filename, 0, 0, 0, 0, 0
- .ImageConvert 6, 2, 0, 0, 0, 0, 0
-
- REM This changes the name. Delete this section to overwrite file
- lenfilename& = LEN(filename)
- filename = LEFT(filename, lenfilename - 3)
- filename = filename + "16"
- REM end rem
-
- .FileSave filename, 769, 0
- END WITHOBJECT
-
- END SUB
-