🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.ms.programmer
Article #2781

Remap VGA system palette

#2781
From: LO,KWOK TUNG BRIAN
Date: Wed, 22 May 1991 04:22
36 lines
1703 bytes

I am trying to write a program to make the 16 static colors
in a VGA configuration available, and remap them to form a 
continuous 16 levels gray scale. I know after executing 
SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC), the palette manager
should release all but pure black and white colors to the 
application with the focus.

I did just that and then realized a palette with 16 gray colors. 
But it did not work, I even put in the UnrealizeObject() function 
as indicate in the SDK Prog Ref. Portion of my code is as followed :

   case WM_PAINT:
      hdc = BeginPaint(hwnd, &ps);

      SetSystemPaletteUse(hdc, SYSPAL_NOSTATIC);
      SelectPalette(hdc, hPal, 0);
      RealizePalette(hdc);


Has anyone out there done this before ?  Any suggestion would be
appreciated.

By the way, it works when I switch to a SuperVGA driver with 256
colors. I can really get 254 colors.


::::::::::::::::::::::::::::::::::::  :::::::    ::: 
:#::::::::::::::::::::::::::::::::::  ::::::      ::
:#::::::::::::::::::::::::::::::::::  ::::::  ::  ::
:#::::::::::::::#:::::::::::::::::::  ::::::  ::  ::
:#####:::#:###::::::###:::#:###:::::  ::::::  ::  ::
:#::::#:::#:::::#::#::#::::#:::#::::  ::::::  ::  ::
:#::::#:::#:::::#::#::#::::#:::#::::      ::      ::
:#####::::#:::::#::###:##::#:::#::::      :::    :::
Technical Details
Message-ID: <29593@hydra.gatech.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ncar!gatech!prism!gt0204b

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!cs.utexas.edu!asuvax!ncar!gatech!prism!gt0204b
From: gt0204b@prism.gatech.EDU (LO,KWOK TUNG BRIAN)
Newsgroups: comp.windows.ms.programmer
Subject: Remap VGA system palette
Message-ID: <29593@hydra.gatech.EDU>
Date: 22 May 91 04:22:20 GMT
Organization: Georgia Institute of Technology
Lines: 36