How to ColorKey?

Started by
5 comments, last by Harvester 23 years, 5 months ago
Greets. I need some information regarding the creation of color keys. With 32, 24 and 16bpp, everything looks great and easy. However, if an indexed mode (palette) is used, how do i define and set the color key? Also, when a surface is made so that it holds an alpha channel (of some bits), when in 24bit and 16bit modes, what is really changing? p.s. I checked the DDPF_ related material, but i found no info regarding the above stuff. Thanks.
... LEMMINGS ... LEMMINGS ... LEMMINGS ... LEM..... SpLaSh!...Could this be what we stand like before the mighty One?Are we LeMmIngS or WhAt!? ;)
Advertisement
In palettized modes it is exactly the same. You set dwColorSpaceLowValue and dwColorSpaceHighValue to the color index you want keyed.


Please state the nature of the debugging emergency.


sharewaregames.20m.com

Doesn''t colorkeying in palettized modes work as usual?
Did you try giving it an index instead of an color? I''m assuming you''re relying on DirectX, I also assume you''re only doing 2D stuff. As for alpha channels..I don''t think any of this is supported by DDraw, I know actually getting the alpha values to do any good isn''t.

"Paranoia is the belief in a hidden order behind the visible." - Anonymous
What you give the function are palette indexes rather than RGB colors. So if you want color 0 to be the transparent color, you just say 0. If you want 255 to be the transparent color, you say 255. The fact that indices can be reassigned their colors at runtime makes no difference whatsoever.


Please state the nature of the debugging emergency.


sharewaregames.20m.com

What if we have an alpha channel on the surface?
RGBA color format.

I found on the DX help some more formats that include this. However when i define some trans color, it doesn''t really work! What am i missing?
... LEMMINGS ... LEMMINGS ... LEMMINGS ... LEM..... SpLaSh!...Could this be what we stand like before the mighty One?Are we LeMmIngS or WhAt!? ;)
Are you using Direct3D?


Please state the nature of the debugging emergency.


sharewaregames.20m.com

yep,... (sorry, forgot to mention that before )
... LEMMINGS ... LEMMINGS ... LEMMINGS ... LEM..... SpLaSh!...Could this be what we stand like before the mighty One?Are we LeMmIngS or WhAt!? ;)

This topic is closed to new replies.

Advertisement