oracle@dayton.saic.com (09/21/90)
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