🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

grey scales on a color monitor?

#375
From: news
Date: Tue, 14 Apr 1992 02:14
42 lines
1357 bytes
I've got another strange problem here...  I need to get a grey-scale
effect on color monitors (customer demands it...)   

You'd think I could set a palette thus:


MyLogPalette = (LPLOGPALETTE)
farmalloc(sizeof(LOGPALETTE) + sizeof(PALETTEENTRY) * 256);
	 
MyLogPalette->palVersion = 0x300;

MyLogPalette->palNumEntries = 256;

for (i = 0; i <= 256; ++i)
{

   MyLogPalette->palPalEntry[i].peRed   = i;
   MyLogPalette->palPalEntry[i].peGreen = i;
   MyLogPalette->palPalEntry[i].peBlue  = i;
   MyLogPalette->palPalEntry[i].peFlags = 0;
}

						       
And this almost works.  Almost everything comes out as grey scales, but
three or four of the colors come out wrong, a sort of an off-white, a 
garish purple, and an aquamarine color for sure and possibly one other.

What am I missing here?  I get the same results both on Trident-based 
systems and on Tseng-based systems, so it's not hardware.  The images I'm
working with were created as 8-bit values, and I'm just feeding those values
to an old-style bitmap.

I'd appreciate any help.

Ted Holden
HTE



-- 
HTE
bear
Technical Details
Message-ID: <2728@fedfil.UUCP>
Path: arc1-ca.pugleaf.net!sparky!uunet!fedfil!news

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!fedfil!news
From: news@fedfil.UUCP (news)
Newsgroups: comp.windows.ms.programmer
Subject: grey scales on a color monitor?
Message-ID: <2728@fedfil.UUCP>
Date: 14 Apr 92 02:14:54 GMT
Organization: HTE
Lines: 42