Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF - using video as background

Tags:

c#

wpf

I was wondering if it's possible to use a video as a background in WPF? What I mean with this is that I want to have a video playing in the background with my controls on top of it. If you still don't quite understand me you should take a look at this site: http://www.barrelny.com/recap/2012/. Is this possible to achive in WPF? if so, how do I do this?

like image 333
Berend Hulshof Avatar asked Mar 12 '26 20:03

Berend Hulshof


1 Answers

You can use VisualBrush for more information visit the msdn link

For example in following code snippet I am using video background in button

<Button.Background>
    <VisualBrush>
      <VisualBrush.Visual>
        <StackPanel Background="White">
          <Image Source="MyFile.wmv" Opacity="0.3"></Image>
        </StackPanel>
      </VisualBrush.Visual>
    </VisualBrush>
 </Button.Background>
like image 190
santosh singh Avatar answered Mar 14 '26 10:03

santosh singh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!