• ### Announcements

#### Archived

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

# SetColorKey and 16bit graphics

## Recommended Posts

Hi all I''m rather new in the DirectX field at large. Thus, I''m delving into using 16 bit graphics and finally abandoning the annoying 8-bit arena. So I''ve set up my primary surface as 640x480x16 Also, I''ve set up an offscreen_plain surface loaded with a bitmap (24 bit, automatically converted, right?) Now I want to set the colorkey in the offscreen_plain surface, but how is the 16 bit surface set up? Does it use 5-bit per color channel, and how are they arranged? RRRRR GGGGG BBBBB X ? In my frustration I didn''t really care, so I figured I just wanted to see if the SetColorKey worked at all in 16 bit. Thus, I set up the DDCOLORKEY structure as follows: colorKey.dwColorSpaceLowValue := $FFFE; colorKey.dwColorSpaceHighValue :=$FFFF; Yep, that''s right: Delphi ... but I''m sure you get the picture. I figured that whatever I set up the colorkey space to be, as long as I kept it rather small, I was sure that something from my bitmap would be displayed when blitted. I made the call as: FBitmap.SetColorKey(DDCKEY_COLORSPACE or DDCKEY_SRCBLT, @colorKey); and the actual blit with DDBLTFAST_SRCCOLORKEY or DDBLTFAST_WAIT. However, nothing is displayed. Absolutely nothing! Removing all references to colorkeying and making the blit with DDBLTFAST_NOCOLORKEY copied the bitmap as it should, but ofcourse also *with* the supposedly transparent color. What am I doing wrong? (besides using Delphi, I know, I know) Regards Toft

• ### Forum Statistics

• Total Topics
627736
• Total Posts
2978869

• 10
• 10
• 21
• 14
• 12