Jump to content
  • Advertisement
Sign in to follow this  
123abcd1983

how to make the picture border disappear

This topic is 4127 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
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.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!