how to make the picture border disappear

Started by
0 comments, last by Agony 17 years, 1 month ago
hi, i have a background picture, and a duck picture move on top of the background picture, but the duck picture is a rectacle which have white background, just wondering is it possible to make the white color area in the duck picture make it match to the color of the background picture.
Advertisement
If you load the image from a file using one of the D3DXLoadSurface* or D3DXCreateTexture* functions, then one of the parameters is a ColorKey parameter. Set that to the value of the color you want to be transparent. (This is frequently chosen to be an ugly color that stands out, so that the color is never needed in the actually visible part of the image, and is obvious when editing the image, such as magenta, or 0xFFFF00FF in ARGB.) You must also make sure that your texture format includes an alpha component (D3DFMT_A8R8G8B8 is the most straightforward and common). Once you've done that, you also must make sure that at least alpha-testing is enabled and configured properly.
"We should have a great fewer disputes in the world if words were taken for what they are, the signs of our ideas only, and not for things themselves." - John Locke

This topic is closed to new replies.

Advertisement