Archived

This topic is now archived and is closed to further replies.

Transparent Bltting

This topic is 5974 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''m moving from the Windows API to DX. I am using DirectDraw because I am using 2D graphics and I don''t want to deal with the rediculous way DirectGraphics handles 2D. How do I Blt() a simple 2-D graphic with transparency using a mask? Shalom

Share this post


Link to post
Share on other sites
Sorry, I don''t have any code with me here right now so I just have to be general.

You can''t blit using a mask. What you have to do is make all of the locations you want transparent a certain color in your image that is not used anywhere else in your image. Then you have to use the surface Color Keying functions to set that color as the color key. You can either encode a pixel if you know the RGB of the color and use that or just lock the surface, get a pixel that you know is the background color and use it.

Sorry that was so cryptic, I hope I got the basics across.

Share this post


Link to post
Share on other sites