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)
?
Loading bitmaps or sprites with palatte
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
;******************************************
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
;******************************************
