Direct Draw Source Color Keying

Started by
16 comments, last by Swatter555 20 years, 7 months ago
LOL, Im not complaining either...you can see the massive response I have gotten in this thread. Any help is very appreciated.
Advertisement
This is what I meant by low and high values

key.dwColorSpaceLowValue = _RGB32BIT (255,lred,lgreen,lblue); key.dwColorSpaceHighValue= _RGB32BIT(255,hred,hgreen,hblue);


You SHOULD keep the same color values throughout the whole app.

I am not sure what else you are looking for, as long as a color in a texture is within this range, you should have no problems.

*NOTE

I saw you used RGB32BIT, are you sure you are loading 32 bit texures? If not, you would ned RGB 5,6,5 or 5,5,5 (16 bit) or RGB 8,8,8 24 bit.

The key color low and high values need to match the format for the back buffer.

I hope I am making some sence!
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
Ya, I think we are on the same page. The display is 32bit and the loader converts the bitmaps into the bpp of the primary surface.

I am using the loader provided here:
http://www.mvps.org/directx/articles/color_depth_conversion.htm

My code is the same, except I do convert the the color key format, something he left out of his code.

Maybe you can make something out of this if you check his code.





Could someone please look at the above source code and tell me what is the problem. I think this thread has been here 2 1/2 days, and only one person has responded. Any help would be very appreciated.
swatter, the code looks decent, and I can''t see anything wrong with it. Perhaps it''s in your rendering code?
TechleadEnilno, the Ultima 2 projectwww.dr-code.org/enilno
Thanks RhoneRanger, I will go back and look at everything in its entirety.
This is my blit call:

if(FAILED(lpddsback->Blt(&blit_rect_dest, bmp_surface, &blit_rect_source,(DDBLT_WAIT | DDBLT_KEYSRC),NULL)))


For range color keying, is there another flag I need to use? I will check the directx docs in tandem with this post.
Ok, if anyone is still paying attention. Could someone give me a link or some source code that shows a working example of range color keying. Preferably a full program, but not too big. Thanks in advance

This topic is closed to new replies.

Advertisement