Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Why does my Color Key fail when using 16 bit color depth?

bit color color key depth fail
0
Posted

Why does my Color Key fail when using 16 bit color depth?

0

16 bit color depth is supported through several different bit arrangements, including 5-5-5 and 5-6-5. This is dependant upon the video hardware and driver, so you must determine what the pixel value for your color key will be at run time. This may be accomplished by reading the pixel format using IDirectDrawSurface::GetPixelFormat() and examining the bitmask values for each color channel, returned in dwBBitMask / dwGBitMask / dwRBitMask members of the structure filled by this function. For example, if we were using a saturated green key (RGB 0,255,0) we could use the following code to determine the proper key value to set: DDPIXELFORMAT pf; ZeroMemory(&pf,sizeof(pf)); pf.dwSize=sizeof(pf); lpDDSPrimary->GetPixelFormat(&pf); DWORD KeyColor=pf.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123