
thank you to anyone in advance,
-Andrew
Code: Select all
DIM BmpHeader AS BMPHeaderType
Code: Select all
OPEN "demo.bmp" FOR BINARY AS #1
Code: Select all
GET #1, , BmpHeader
Code: Select all
SCREEN 13
Code: Select all
a$ = BmpHeader.pal
Code: Select all
OUT &H3C8, 0
Code: Select all
FOR I% = 1 TO 1024 STEP 4
Code: Select all
b% = ASC(MID$(a$, I%, 1)) \ 4
Code: Select all
g% = ASC(MID$(a$, I% + 1, 1)) \ 4
Code: Select all
r% = ASC(MID$(a$, I% + 2, 1)) \ 4
Code: Select all
OUT &H3C9, r%
OUT &H3C9, g%
OUT &H3C9, b%
Code: Select all
NEXT
Code: Select all
DIM Pixel AS STRING * 1
Code: Select all
iHeight% = BmpHeader.hei - 1
Code: Select all
iWidth% = BmpHeader.wid - 1
Code: Select all
FOR y% = iHeight% TO 0 STEP -1
Code: Select all
FOR x% = 0 TO iWidth%
Code: Select all
GET #1, , Pixel
Code: Select all
PSET (x%, y%), ASC(Pixel)
Code: Select all
NEXT x%, y%
Code: Select all
CLOSE #1
Code: Select all
OUT &H3C8, 0
Code: Select all
OUT &H3C8, 0
Code: Select all
OUT &H3C8, 0
Code: Select all
TYPE BMPHeaderType
id AS STRING * 2 'Should be "BM"
size AS LONG 'Size of the data
rr1 AS INTEGER '
rr2 AS INTEGER '
offset AS LONG 'Position of start of pixel data
horz AS LONG '
wid AS LONG 'Image width
hei AS LONG 'Image height
planes AS INTEGER '
bpp AS INTEGER 'should read 8 for a 256 colour image
pakbyte AS LONG '
imagebytes AS LONG 'Width*Height
xres AS LONG '
yres AS LONG '
colch AS LONG '
ic AS LONG '
pal AS STRING * 1024 'Stored as Blue, Green, Red, 0
END TYPE
DIM BmpHeader AS BMPHeaderType
OPEN "1.bmp" FOR BINARY AS #1
GET #1, , BmpHeader
' Don't close the file just yet - were not finished!
SCREEN 13 'Set graphics mode
a$ = BmpHeader.pal 'Pal is stored in a 1024 character string
OUT &H3C8, 0 'Start writing form colour 0
FOR I% = 1 TO 1024 STEP 4
b% = ASC(MID$(a$, I%, 1)) \ 4 'blue
g% = ASC(MID$(a$, I% + 1, 1)) \ 4 'green
r% = ASC(MID$(a$, I% + 2, 1)) \ 4 'red
'I% + 3 is set to zero.
OUT &H3C8, r%
OUT &H3C8, g%
OUT &H3C8, b%
NEXT
DIM Pixel AS STRING * 1 'Our pixel "byte"
iHeight% = BmpHeader.hei - 1 'Subtract 1 for actual screen position
iWidth% = BmpHeader.wid - 1 '
FOR y% = iHeight TO 0 STEP -1 'Coutdown for upsidedown image
FOR x% = 0 TO iWidth%
GET #1, , Pixel
PSET (x%, y%), ASC(Pixel)
NEXT x%, y%
CLOSE #1
i got it in 8 bit (it was still in 16 somehow) but its the same thing, but nnow the line is a bunch of random colors...burger2227 wrote:Did you save it as an 8 bit bitmap? Paint is not the greatest kind of image editor. You should be able to set the palette's BPP to 8 in Photoshop. Your code is from here I gather and it should work for screen 13.
Does it load at all? If it is skewed, the bitmap needs a padder.
Ted
Nodvelt is a well known programmer who rarely finishes what he starts!
Code: Select all
FOR y% = iHeight TO 0 STEP -1 'Coutdown for upsidedown image
Code: Select all
FOR y% = iHeight% TO 0 STEP -1 'Coutdown for upsidedown image