Rendering transparent textures in directX
- by Vibhore Tanwer
I am working with a directX application with WPF, I am facing a problem with videos and images that contains transparent pixels, I have to draw a color in background an then a video/image over it. What I expect is background color should be visible while playing video only non transparent pixels should be visible but what I get is a black background behind the video.
I am using following settings on device to achieve alpha blending :
device.RenderState.SourceBlend = Blend.SourceAlpha;
device.RenderState.DestinationBlend = Blend.InvSourceAlpha;
device.RenderState.AlphaBlendEnable = true;
What am I missing here? What is the best approach to handle transparent videos?
Any help will be of great value to me.