Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Screen 12 BMP loader
#1
Does anyone know where i can get a SCREEN 12 BMP loader (it HAS to be screen 12)
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#2
Dunno if this thing still works. It's not my code BTW. I must've edited it...
Code:
DECLARE FUNCTION LoadBitMap% (FileName AS STRING, XRes AS INTEGER, YRes AS INTEGER, Future AS INTEGER)

TYPE BMPType
        ID            AS STRING * 2
        BMPFileSize   AS LONG
        r1            AS INTEGER
        r2            AS INTEGER
        BMPOffSetData AS LONG
        BMPHSize      AS LONG
        BMPWid        AS LONG
        BMPHei        AS LONG
        NofPlanes     AS INTEGER
        BitsPerPix    AS INTEGER
        BMPComp       AS LONG
        BMPISize      AS LONG
        BMPXPos       AS LONG
        BMPYpos       AS LONG
        BMPColours    AS LONG
        BMPImpClrs    AS LONG
        BMPPal        AS STRING * 1024
END TYPE
DIM SHARED BMP AS BMPType
DIM SHARED Byte AS STRING * 1

F$ = "foo.bmp"

OPEN F$ FOR BINARY AS #1

GET #1, , BMP

SCREEN 12
'SCREEN 0
'CLS
'
'PRINT "ID of File     :  "; Bmp.ID
'PRINT "Bits Per Pixel : "; Bmp.BitsPerPix
'PRINT "Width          : "; Bmp.BMPWid
'PRINT "Height         : "; Bmp.BMPHei
'PRINT "Compression    : "; Bmp.BMPComp
'PRINT "File Size      : "; LEFT$(STR$(Bmp.BMPFileSize / 1024), 7); "Kb"
'
'a$ = INPUT$(1)

a = LoadBitMap(F$, 320, 200, 0)


DEFINT A-Z
FUNCTION LoadBitMap (FileName AS STRING, XRes AS INTEGER, YRes AS INTEGER, Future AS INTEGER)
IF BMP.ID = "BM" THEN
        Success = 1
ELSE
        Success = 0
END IF

IF Future = 1 THEN
'        Set800x600 8
'        FUTURE.CLS 0
ELSEIF Future = 0 THEN
        SCREEN 13
END IF

BMP.BMPXPos = (XRes / 2) - (BMP.BMPWid / 2)
BMP.BMPYpos = (YRes / 2) - (BMP.BMPHei / 2)

FOR attr = 0 TO 255
   OUT &H3C8, attr

   FOR rgb = 1 TO 3
       GET #1, attr * 4 + 58 - rgb, Byte
       OUT &H3C9, INT(ASC(Byte) * .2471)
   NEXT
NEXT

FOR ypl& = 1 TO BMP.BMPHei
    FOR xpl& = 1 TO BMP.BMPWid
        bpl& = LOF(1) - (ypl& * (3 - (BMP.BMPWid + 3) MOD 4)) - ypl& * BMP.BMPWid + xpl&
        GET #1, bpl&, attr

        IF Future = 1 THEN
                'Future.PSET BMP.BMPXPos + xpl& - 1, BMP.BMPYpos + ypl& - 1, attr
        ELSEIF Future = 0 THEN
                PSET (BMP.BMPXPos + xpl& - 1, BMP.BMPYpos + ypl& - 1), attr
        END IF
    NEXT
NEXT

IF Success = 0 THEN
        LoadBitMap = 0
ELSE
        LoadBitMap = 1
END IF
END FUNCTION
Reply
#3
What BMP format does it load (24 bit etc) cause aa i got was a white screen with a yellowy middle?
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply
#4
er... true screen 12 in qb has only 16 color indexes, loading a 24-bit bitmap in its raw form would be impossible
Reply
#5
Um, all i get is Bad File name and i ment will i have to use 4-bit bmp's or 16 bit?
url=http://www.sloganizer.net/en/][Image: style4,TheDarkJay.png][/url]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)