Hi,
I'm working with C++ and DirectX 9 (2D). I'm using loading some pictures into surfaces, with D3DXLoadSurfaceFromFile, and I set the color key parameter to a color, for example green. Then, when I draw this surface on the screen with StretchRect, all that was green in the picture is now black. But I want that green is changed for transparent. How do I do that

Color keying
John Wycoff
When you load an image with a color key you have to set it with a alpha value of 255
This because the loader will interpret your green as Opaque so will use a alpha of 255 to compare...Just specify green color will result in no transparency unless your image had an alpha of 0...which is probably not the case
Secondly you need to set the Alpha Operator and Function for this to work
Basicly your load will create an alpha channel...you still have to use it
It's better explained in this link :
http://www.mvps.org/directx/articles/colorkeydx8.htm