Article View: comp.os.msdos.programmer
Article #2308System Palette Mod under Windows SDK ver 3.0?
From: oracle
Date: Fri, 21 Sep 1990 14:16
Date: Fri, 21 Sep 1990 14:16
63 lines
2188 bytes
2188 bytes
I have a question about modifying the system palette using the
Microsoft Windows SDK (Ver 3.0 )! How is it done!?
I need to reset the palette to 16 solid shades of gray for an
imagery display application. The following summarizes the steps I
used unsuccessfully!
NPLOGPALETTE pLogPal;
.
.
.
hDC = GetDC( hWnd );
pLogPal = (NPLOGPALETTE) LocalAlloc (LMEM_FIXED,
(sizeof (LOGPALETTE) +
(sizeof (PALETTEENTRY) * (PALETTESIZE))));
pLogPal->palVersion = 0x300;
pLogPal->palNumEntries = PALETTESIZE; /* 16 */
pLogPal->palPalEntry[0].peRed = (BYTE)0;
pLogPal->palPalEntry[0].peGreen = (BYTE)0;
pLogPal->palPalEntry[0].peBlue = (BYTE)0;
pLogPal->palPalEntry[0].pePlags = (BYTE)0;
.
. /* Entries 1 thru 15 set */
. /* 17, 34, 51, 68, 85, 102, 119, */
. /* 136, 153, 170, 204, 221, 238, 255 */
.
hPal = CreatePalette( (LPLOGPALETTE) pLogPal);
SetSystemPaletteUse( hDC, SYSPAL_NOSTATIC );
SelectPalette( hDC, hPal, 1);
RealizePalette( hDC );
SendMessage( 0xFFFF, WM_SYSCOLORCHANGE, NULL, NULL );
.
.
.
When I attempt to post pixels to the screen, I use the following
call.
SetPixel( hDC, x, y, RGB( 17, 17, 17 ) ); /* Explicit RGB Call */
I am really frustrated, and would appreciate any help! Please mail
responses to the address posted below.
THANX in ADVANCE!
Tim G.
_____________________________________________________________________________
____ ____ ___ Tim Granger
/___ /___/ / / Science Applications International Corporation
____// / / /___ Dayton, Ohio
-----------------------------------------------------------------------------
Internet: Oracle@Dayton.SAIC.COM uucp: uunet!dayvb!Oracle
Technical Details
Message-ID:
<1251.26f9e89b@dayton.saic.com>Path:
arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!dayvb!oracleShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!dayvb!oracle From: oracle@dayton.saic.com Newsgroups: comp.os.msdos.programmer Subject: System Palette Mod under Windows SDK ver 3.0? Message-ID: <1251.26f9e89b@dayton.saic.com> Date: 21 Sep 90 14:16:58 GMT Organization: Science Applications Intl. Corp., Dayton, Ohio Lines: 63