#### Archived

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

# DDSetColorKey

## Recommended Posts

Sorry to bother yuo all with this question but I have a small problem with DDSetColorKey. I have set the trasparent color to RGB(0,0,0) for an image but the black box around the image still shows up. Anyone know what the problem could be?

##### Share on other sites
Are you checking that your call to SetColorKey succeeds? That would be my first suggestion. If that works, then i would check that the "black" on your image is actually (0,0,0) and not, say, (10,10,10) or something else. There is a wide color range that will appear black on most monitors even when it''s not (0,0,0).

~don

"They that can give up essential liberty to obtain temporary safety deserve neither liberty nor safety."
- Benjamin Franklin

##### Share on other sites
Yeah I have checked them both and it still doesnt work... =(
I''m using 24-bits bmp file.
Do I then have to use something else than just RGB(0,0,0)?

##### Share on other sites
Have you set the colors to be transparent?

DDCOLORKEY key;/**************\key.dwColorSpaceLowValue  = RGB(0,0,0);key.dwColorSpaceHighValue = RGB(0,0,0);/**************\lpDDSbmp->SetColorKey(DDCKEY_SRCBLT, &key);// lpDDSbmp is the surface that the sprite is on

Make games, it''s fun

##### Share on other sites
I tryed your code but it still seem''s not to work. =(
My other sprites works just fine but this..
I think I''ll try making a new image. That maybe will help, cause
you can never be to sure.

By the way thanks for the reply''s. =) My first post here...

• ### Forum Statistics

• Total Topics
628336
• Total Posts
2982156

• 9
• 24
• 9
• 9
• 13