
SetColorKey?
Im using DX7, and I was wondering how to use SetColorKey, the reason why I need to use it is because I dont want it to draw the black pixels on the textures. I was thinking I could do this with SetColorKey. Example would Help
Thanks

If I understand correctly this is what you want:
void SetColourKey(LPDIRECTDRAWSURFACE* surface, DWORD colour)
{
DDCOLORKEY colourKey; //Struct for colour keying
//Set the colour you want as transparent
colourKey.dwColorSpaceLowValue = colour;
colourKey.dwColorSpaceHighValue = colour;
surface->SetColorKey(DDCKEY_SRCBLT, &colourKey);
//Should check the return from here
}
This function will make sure that any pixels of that colour are not blitted from that surface. So for black you would set colour = 0.
Look in the DX help for "SetColorKey()" for return values and other flags.
---------------
Andrew
Edited by - acraig on 1/15/00 6:22:44 PM
Edited by - acraig on 1/15/00 6:24:42 PM
void SetColourKey(LPDIRECTDRAWSURFACE* surface, DWORD colour)
{
DDCOLORKEY colourKey; //Struct for colour keying
//Set the colour you want as transparent
colourKey.dwColorSpaceLowValue = colour;
colourKey.dwColorSpaceHighValue = colour;
surface->SetColorKey(DDCKEY_SRCBLT, &colourKey);
//Should check the return from here
}
This function will make sure that any pixels of that colour are not blitted from that surface. So for black you would set colour = 0.
Look in the DX help for "SetColorKey()" for return values and other flags.
---------------
Andrew
Edited by - acraig on 1/15/00 6:22:44 PM
Edited by - acraig on 1/15/00 6:24:42 PM
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement