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.

  • 1
    \$\begingroup\$ I highly doubt that any video codec supports transparent pixels. \$\endgroup\$ – r2d2rigo Jul 6 '12 at 8:07
  • \$\begingroup\$ r2d2rigo : My video is .mov file and after a quick google search I found that .mov supports transparency/ alpha. I didn't found any reliable source yet that can confirm this, but I am pretty sure that .mov supports it. \$\endgroup\$ – Vibhore Tanwer Jul 6 '12 at 10:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.