Problems with change PALETTE

Please use this Board for QBasic related requests ( file research, programming, etc.)

Moderators:Administrator, Global Moderator

Post Reply
Meerschweinchen
Newbie
Posts:2
Joined:Sun Feb 13, 2005 7:43 pm
Problems with change PALETTE

Post by Meerschweinchen » Mon Feb 14, 2005 9:53 am

Hi All,
may somebody can help me.
I don't know how to change PALETTE colors on SCREEN 12.
I have always the standard 16 colors.

My routine to load a BMP File ist very fast but only with standard Colors :(
PALETTE 1, mycolor doesnt works realy. :(

Dateikopf$ = SPACE$(54)
SCREEN 12

OPEN "test.bmp" FOR BINARY AS #2

GET #2, 1, Dateikopf$

BildBreite = CVL(MID$(Dateikopf$, 19, 4))
BildHoehe = CVL(MID$(Dateikopf$, 23, 4))
SEEK #2, CVL(MID$(Dateikopf$, 11, 4)) + 1
Daten$ = SPACE$(BildBreite / 2)
Laenge = (BildBreite \ 2) - 1

FOR Y = (BildHoehe - 1) TO 0 STEP -1
GET #2, , Daten$
FOR X = 0 TO Laenge
byte = ASC(MID$(Daten$, X + 1, 1))
PSET (X * 2, Y), byte \ 16
PSET (X * 2 + 1, Y), byte AND 15
NEXT
NEXT

CLOSE #2

Ralph
QBasic God
Posts:134
Joined:Sat Nov 06, 2004 2:27 am
Location:Katy, Texas

Post by Ralph » Tue Feb 15, 2005 5:26 am

While in QuickBASIC 4.5, click on Help, then doubale click on Index, select Palette, and, there, select Details, and go to the end of that window, where it shows the colors available for the various screen modes. You will see that SCREEN 12 only has 16 colors available, namely, 0 to 15.
Ralph. Running QuickBASIC Version 4.5, Windows XP Home Edition, Version 2002, Service Pack 2, and HP LaserJet 4L printer.

Post Reply