Home > Back-end >  Windows palette problem
Windows palette problem

Time:11-01

Source code for the following
The static HPALETTE HPALETTE.
Int I;
HDC HDC.

HDC=GetDC (HWND);
PLP=(LOGPALETTE *) malloc (sizeof (LOGPALETTE) + 33 * sizeof (PALETTEENTRY));

PLP - & gt; PalVersion=GetDeviceCaps (HDC, DRIVERVERSION);//0 x0300;
PLP - & gt; PalNumEntries=34;//GetDeviceCaps (HDC, NUMFONTS);//34;

For (I=0; i <34. I++)
{
PLP - & gt; PalPalEntry [I] peRed=255;
PLP - & gt; PalPalEntry [I] peGreen=(I==0? 0-255);
PLP - & gt; PalPalEntry [I] peBlue=(I==0? 0-255);
PLP - & gt; PalPalEntry [I] peFlags=(I==33? 0: PC_RESERVED);
}
HPalette=CreatePalette (PLP);



What's the reason why hPalette has been empty? Why create failure?

CodePudding user response:

If (GetDeviceCaps (HDC, RASTERCAPS) & amp; RC_PALETTE)...

CodePudding user response:

reference 1/f, play big shoot early nuclear response:
if (GetDeviceCaps (HDC, RASTERCAPS) & amp; RC_PALETTE)...

How does it work? Add to that?

CodePudding user response:

reference 1/f, play big shoot early nuclear response:
if (GetDeviceCaps (HDC, RASTERCAPS) & amp; RC_PALETTE)...

This seems to be no use?

CodePudding user response:

To test whether a DC support palette
  • Related