Semi-Transparent blitting

Started by
4 comments, last by jsmawais 20 years, 6 months ago
Hi. Can someone tell how to do semi-transparent blitts in DirectDraw with the help of color-keying? Thanks in advance.
Advertisement
It''s all in the SDK.
Trust me when I say this. Seriosuly, I am talking from experience:
Do not even attempt to do this in DirectDraw.
What you are looking for is called alpha-blending. Search the DirectX forum with these keywords - alpha-blending directdraw transparencey - and you will see exactly why after reading a few topics. Trust me. Do not try alpha-blending in DD it will just piss you off. If you really need it you will need to use Direct3D.
Color-keying and alpha blending are completely different things.
Color-key masks off pixels based on the mask color, while alpha blending literally "blends" the source and destination pixels by the alpha factor.

Colorkeying is entirely possible in hardware with ddraw, and sdk does explain how to use it.

On the other hand, hardware color keying isn''t available anymore in d3d, while AB is.

-Nik

Niko Suni

Or you may want to make your own alpha blitter.
OMG sorry I think I may have misunderstood your question. I thought you wanted to do a semi-transperent pixel effect, and you thought that color-keying might be used to do this. Re-reading the original post, I now understand that you infact want to blit images that have trasparent areas (such as a trasparent background behind a character)?

This topic is closed to new replies.

Advertisement