Archived

This topic is now archived and is closed to further replies.

Chyron

32Bit Color Keying in DirectDraw

Recommended Posts

Sorry for such a simple question, but can you use RGB values to set a color key? i.e. can you do this: ddck.dwColorSpaceLowValue = RGB(255,0,0); ddck.dwColorSpaceHighValue = RGB(255,0,0);

Share this post


Link to post
Share on other sites
Hey-

Actually, I think that''s the way you HAVE to do it.

In DDraw, the RGB() macro is one of the only ways to get a COLORREF value out of the 3 uchar color values.

-Hyren




"Back to the code mines... ka-chink... ka-chink..."
vidgamez.iwarp.com

Share this post


Link to post
Share on other sites
dwColorSpaceHighValue and dwColorSpaceLowValue are not COLORREFs, they are DWORDs containing the colors in the pixel format of the target surface. So, in 16-bit 565 mode, 0x7E0 is pure green, and 0x0000 is pure black, 0xFFFF is pure white.

In X8R8G8B8 32-bit color, pure green would be 0x0000FF00, pure white 0x00FFFFFF, pure black 0x00000000, pure blue 0x000000FF etc.

Edited by - furby100 on June 7, 2001 3:45:01 PM

Share this post


Link to post
Share on other sites