=========================================================================== BBS: The Abacus * HST/DS * Potterville MI Date: 05-07-93 (21:23) Number: 36 From: AARON LAPIKAS Refer#: NONE To: JOHN WOODGATE Recvd: NO Subj: GIF Format /2 Conf: (35) Quick Basi --------------------------------------------------------------------------- 'Continued from the last message... SCREEN ScreenMode, 0, 0, 0 ON ERROR GOTO 0 LINE (0, 0)-(319, 199), Background, BF LINE (0, 0)-(639, 479), Background, BF IF ScreenMode = 13 THEN LOCATE 25, (40 - LEN(F$)) \ 2 PRINT UCASE$(F$); ELSEIF ScreenMode = 12 THEN LOCATE 30, (80 - LEN(F$)) \ 2 PRINT UCASE$(F$); END IF PALETTE USING Pal(0) DO Code = ReadCode(CodeSize) IF Code <> EOFCode THEN IF Code = ClearCode THEN CodeSize = InitCodeSize Maxcode = MaxCodes(CodeSize - 2): FreeCode = FirstFree Code = ReadCode(CodeSize): CurCode = Code OldCode = Code: FinChar = Code AND Bitmask Plot FinChar ELSE CurCode = Code: InCode = Code IF Code >= FreeCode THEN CurCode = OldCode Outcode(OutCount) = FinChar OutCount = OutCount + 1 END IF IF CurCode > Bitmask THEN DO Outcode(OutCount) = Suffix(CurCode) OutCount = OutCount + 1 CurCode = Prefix(CurCode) LOOP UNTIL CurCode <= Bitmask END IF FinChar = CurCode AND Bitmask Outcode(OutCount) = FinChar OutCount = OutCount + 1 FOR i = OutCount - 1 TO 0 STEP -1 Plot Outcode(i) NEXT OutCount = 0 Prefix(FreeCode) = OldCode: Suffix(FreeCode) = FinChar OldCode = InCode: FreeCode = FreeCode + 1 IF FreeCode >= Maxcode THEN IF CodeSize < 12 THEN CodeSize = CodeSize + 1: Maxcode = Maxcode * 2 END IF END IF END IF END IF LOOP UNTIL Code = EOFCode CALL Getit END NoVGA: PRINT "Sorry, this program requires a VGA adapter." PRINT "See ya when you get more $$$!" END FUNCTION Getbit STATIC SHARED ByteBuffer AS STRING * 1, Powers(), Bitsin, BlockLength, Num Bitsin = Bitsin + 1 IF Bitsin = 9 THEN GET #1, , ByteBuffer TempChar = ASC(ByteBuffer) Bitsin = 1 Num = Num + 1 IF Num = BlockLength THEN BlockLength = TempChar + 1 GET #1, , ByteBuffer TempChar = ASC(ByteBuffer) Num = 1 END IF END IF IF (TempChar AND Powers(Bitsin)) = 0 THEN Getbit = 0 ELSE Getbit = 1 END FUNCTION DEFSNG A-Z SUB Getit DEF SEG = &HA000 IF ScreenMode% = 13 THEN BSAVE LEFT$(F$, LEN(F$) - 3) + "GRA", 0, 64000 ELSE FOR i% = 0 TO 3 OUT &H3CE, 4 OUT &H3CF, i% BSAVE LEFT$(F$, (LEN(F$) - 3)) + "BP" + CHR$(49 + i%), 0, 38400 NEXT i% END IF DEF SEG DO: LOOP UNTIL LEN(INKEY$) END SUB SUB Plot (a%) STATIC PSET (X%, Y%), a% X% = X% + 1 IF X% > Xend% THEN X% = Xstart% Y% = Y% + 1 END IF END SUB DEFINT A-Z FUNCTION ReadCode (CodeSize) SHARED Powers2() Code = 0 FOR Aa = 0 TO CodeSize - 1 Code = Code + Getbit * Powers2(Aa) NEXT ReadCode = Code END FUNCTION Basically what it does is it displays a GIF, then saves it using BSAVE. The BSAV Ed file can then be viewed MUCH quicker then displaying the original GIF. I als o have the code to show the BSAVEd GIF. If you want it, just ask. I hope this is what you wanted.