07-09-2003, 07:33 PM
here is what i have so far. I am copying as 800x600x24 from 800x600x16, since (my) Paint can't handle 16bit for some reason. I'll convert the colors later, but right now I just want it functioning..
Code:
SUB output.bitmap
OPEN "C:\qbasic\test1.bmp" FOR BINARY AS 1
n$ = "BM": PUT #1, , n$
n& = xRes: n& = n& * yRes: n& = n& + 54: PUT #1, , n&
n% = 0: PUT #1, , n%
n% = 0: PUT #1, , n%
n% = 54: PUT #1, , n%
n& = xRes: PUT #1, , n&
n& = yRes: PUT #1, , n&
n% = 1: PUT #1, , n%
n% = 24: PUT #1, , n%
n% = 0: PUT #1, , n%
n% = 54: PUT #1, , n%
n$ = SPACE$(xRes * 3)
FOR y% = yRes TO 1 STEP -1
x2% = 0
FOR x% = 1 TO xRes
x2% = x2% + 3
temp1& = uglPGet(map, x%, y%)
temp2& = temp1& MOD 4096
temp1& = (temp1& - temp2&) / 4096
temp3& = temp2& MOD 32
temp2& = (temp2& - temp3&) / 32
MID$(n$, x2% - 2, 1) = trim$(STR$(temp1&))
MID$(n$, x2% - 1, 1) = trim$(STR$(temp2&))
MID$(n$, x2%, 1) = trim$(STR$(temp3&))
NEXT x%
PUT #1, , n$
NEXT y%
CLOSE
END SUB