Page 1 of 1

Loading bitmaps or sprites with palatte

Posted: Sat Apr 03, 2004 12:33 pm
by MisterDr
Have anybody solutions to load bitmaps or sprites with palette file? It will be similar like this.

LoadBitmapPal(bitmap number,Filename, PalleteFile)
LoadSprite(sprite number,Filename, PalleteFile)


?

Posted: Mon Apr 05, 2004 1:09 pm
by pg
Hi

You can try this code to load a palette, but I did not really test it!
Works only with 8-Bit Bitmaps.


; LOAD A NEW PALETTE***********************
If InitPalette()
If ReadFile(1, "test.pal") =0
MessageRequester("Error","Palette File not found")
End
EndIf
CreatePalette(1)
Index.w=0
Repeat
R.b=ReadByte()
G.b=ReadByte()
B.b=ReadByte()
SetPaletteColor(Index, RGB(R,G,B) )
Index=Index+1
Until Eof(1) Or Index >= 256 ;768 Bytes
CloseFile(1)
DisplayPalette(1)
endif
;******************************************