dwatling
asked on
DirectDraw SetColorKey problems
I recently modified my application to run at 640x480x16. Before, when it was using 8-bit graphics, transparency worked fine. However, now it does not, unless I use 0 as my source color key. Can someone provide some source or at least tell me what the heck is going on? Here's the code I use to change the color key:
bool DirectDrawSurface::SetColo rKey(COLOR REF color)
{
DDCOLORKEY colorKey;
colorKey.dwColorSpaceLowVa lue=color;
colorKey.dwColorSpaceHighV alue=color Key.dwColo rSpaceLowV alue;
if (Surface->SetColorKey(DDCK EY_SRCBLT, &colorKey) ==DD_OK)
return true;
else return false;
}
bool DirectDrawSurface::SetColo
{
DDCOLORKEY colorKey;
colorKey.dwColorSpaceLowVa
colorKey.dwColorSpaceHighV
if (Surface->SetColorKey(DDCK
return true;
else return false;
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Are you sure you specified a correct RGB value?
ASKER
I defined it as "RGB(255,0,192)". The only thing that I can think of is under 16-bit mode, this color doesn't exist, but a close match does and for some reason or another DDColorMatch doesn't get it.
You can use some graphics utilities to view its color palette and get the exact RGB values.
ASKER
I shall try that. Thanks.
ASKER