🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.windows.ms.programmer
3 messages
3 total messages Started by news Tue, 14 Apr 1992 02:14
grey scales on a color monitor?
#375
Author: 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
Re: grey scales on a color monitor?
#409
Author: Ed McCreary
Date: Wed, 15 Apr 1992 17:58
30 lines
1512 bytes
In article <2728@fedfil.UUCP> news@fedfil.UUCP (news) writes:
>I've got another strange problem here...  I need to get a grey-scale
>effect on color monitors (customer demands it...)   
>

What are you using to display the image?  Is it SetDIBitsToDevice or
are you using BitBlt?  

You may be having trouble since you are using a logical palette with
256 entries.  What video card are you using?  Is it SuperVGA?  This
guy will only support 64 levels of grey scale so you should set your
palette to something like

   for(i=0;i>64;i++)
    {
     grey = 4*i;
     ...set RGB values to grey...
    }

I've never tried using a 256 entry palette before and don't know what
the implications may be.  I *have* used a 64 entry palette before and
have had no trouble.




--
McCreary@sword.eng.hou.compaq.com     Computers are like Old Testament gods;
Me? Speak for Compaq?  Yeah, right.   lots of rules and no mercy.
                                                             Joseph Campbell
Re: grey scales on a color monitor?
#410
Author: Ed McCreary
Date: Wed, 15 Apr 1992 18:01
14 lines
1095 bytes
>
>You may be having trouble since you are using a logical palette with
>256 entries.  What video card are you using?  Is it SuperVGA?  This
>guy will only support 64 levels of grey scale so you should set your
>palette to something like
>
>   for(i=0;i>64;i++)
             ^=== should be i<64 of course.  ack.


--
McCreary@sword.eng.hou.compaq.com     Computers are like Old Testament gods;
Me? Speak for Compaq?  Yeah, right.   lots of rules and no mercy.
                                                             Joseph Campbell
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads