Sign in to follow this  
123abcd1983

how to make the picture border disappear

Recommended Posts

123abcd1983    122
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.

Share this post


Link to post
Share on other sites
Agony    3452
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this