开发者

Silverlight MediaElement issue

开发者 https://www.devze.com 2023-01-01 15:01 出处:网络
I am using Silverlight 3.0 + .Net 3.5 + VSTS 2008 + C# to develop a simple video application using MediaElement of Silverlight.

I am using Silverlight 3.0 + .Net 3.5 + VSTS 2008 + C# to develop a simple video application using MediaElement of Silverlight.

I have two videos and I want to play them at the same time (similar to picture in picture effect) -- i.e. a part of the two videos are overlapped when they are playing (the same concept of Z-Order i开发者_StackOverflow中文版n UI design). I want to play one MediaElement on top of the other MediaElement, and I am wondering how to assign the overlap order (similar to set Z-Order UI element, but I did not find MediaElement has Z-Order property)?


You could place your MediaElement inside of a Canvas. The Elements inside a Canvas Element inherit it's Canvas.ZIndex Attribute.

<Canvas x:Name="MediaPlayerPanel" Width="200" Height="200">  
  <MediaElement x:Name="Media1" Height="200" Width="200" Source="file1.wmv" Canvas.ZIndex="1" />
  <MediaElement x:Name="Media2" Canvas.Top="20" Canvas.Left="20" Height="100" Width="100" Source="file2.wmv" Canvas.ZIndex="2" />
</Canvas>

This should work for you!

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号