views:

490

answers:

1

I have a mediaelement tag in my wpf-window. It's playing a simple animation, similar to the windows xp copy file dialog.

The animation has an ugly pink background #FF00FF, that I want to be transparent. I've tried setting the color in the OpacityMask attribute, but the color remains. Any ideas on how I can remove the color from the video?

+2  A: 

You can use a shader effect to remove a specific color. Luckily this type of shader is part of the WPF Pixel Shader Effects Library - http://www.codeplex.com/wpffx which is available free of charge. The effect that you should look at is called ColorKeyAlpha.

Here you can find more info on the subject and if you are new to shaders this blog series has all the information you will need -

Milan Nankov