'=========================================================================== ' Subject: BSAVE/BLOAD W/PALETTE Date: 05-06-97 (16:41) ' Author: Dave Shea Code: QB, QBasic, PDS ' Origin: FidoNet QUIK_BAS Echo Packet: GRAPHICS.ABC '=========================================================================== '>I'm nearly done with a graphics conversion program that loads BMP, PCX and '>files, then saves them to a format that is loadable in QB. I'm having problem '>with that format (I call it "QIM"). I want to tag on the palette information '>to a BSAVEd file, but when I load the file, its a mess of colored dots instead '>of the original image. 'Here's something that I developed four months ago, which did come 'through the echo at least once. =u) ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-= ' PALS&L.BAS by Dave Shea ' Released to Public Domain ' on January 12th, 1996. No ' Warantees expressed or ' implied. ' =-=-=-=-=-=-=-=-=-=-=-=-=-=-= DECLARE SUB PalBLoad (FileName$) DECLARE SUB PalBSave (FileName$) CLS : SCREEN 13 TYPE Colr Dat AS STRING * 3 END TYPE SUB PalBLoad (FileName$) DIM Col AS Colr OPEN FileName$ FOR BINARY AS #1 FOR a = 0 TO 255 GET #1, 64008 + a * 3, Col.Dat OUT &H3C8, a OUT &H3C9, ASC(MID$(Col.Dat, 1, 1)) OUT &H3C9, ASC(MID$(Col.Dat, 2, 1)) OUT &H3C9, ASC(MID$(Col.Dat, 3, 1)) NEXT CLOSE #1 DEF SEG = &HA000 BLOAD FileName$ END SUB SUB PalBSave (FileName$) DEF SEG = &HA000 BSAVE FileName$, 0, 64000 OPEN FileName$ FOR APPEND AS #1 FOR a = 0 TO 255 OUT &H3C7, a Red = INP(&H3C9) Green = INP(&H3C9) Blue = INP(&H3C9) PRINT #1, CHR$(Red); PRINT #1, CHR$(Green); PRINT #1, CHR$(Blue); NEXT CLOSE #1 END SUB