*BSD News Article 42623


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!uwm.edu!news.alpha.net!news.mathworks.com!uunet!in1.uu.net!newsfeed.ACO.net!info.univie.ac.at!usenet
From: hagen@kfs.oeaw.ac.at (Hagen)
Newsgroups: comp.os.386bsd.development
Subject: How to accsess a Windows palette by physical palette index?
Date: 18 Feb 1995 19:12:02 GMT
Organization: Vienna University Computer Center, Austria
Lines: 32
Message-ID: <3i5gq2$jrk@infosrv.edvz.univie.ac.at>
NNTP-Posting-Host: schouten.kfs.oeaw.ac.at
X-Newsreader: WinVN 0.92.1

How to accsess a Windows palette by physical palette index?

A special drawing action needs to use the color of a given physical palette index for a
logical operation with SetROP2. So a creation of a logical Palette with peFlags set
to PC_EXPLICIT (and a pen with PALETTEINDEX to the logical palette) is
neccesery. How can I modify the color on a physical palette index? If I try to modify
my logical palette with peFlags set to PC_RESERVED (for the animation process)
Windows maps my new color somewhere but does not modify the color on the needed
index. I can't set a color by identifying it with physical index like peFlags set to
PC_EXPLICIT. Windows should run in 256 color VGA mode.
The folowing code does not fit the needs:

//Set logical palette with a physical palette index
LOGPALETTE logPal;
logPal.palVersion =  0x300;
logPal.palNumEntries =  1;
logPal.palPalEntry[0].peRed =		1; // physical palette index
logPal.palPalEntry[0].peGreen =	0;
logPal.palPalEntry[0].peBlue =	0;
logPal.palPalEntry[0].peFlags =	PC_EXPLICIT;
...
//CreatePalette & SelectPalette etc.

//Create a PaletteEntry
PALETTEENTRY palEntry;
palEntry.peRed =		something;
palEntry.peGreen =	something;
palEntry.peBlue = 	something;
palEntry.peFlags =	PC_RESERVED; // must set for animation

// AnimatePalette & RealizePalette etc.