Это можно сделать, установив свойство Clip в MediaElement. Вы можете установить любое значение PathGeometry, ниже приведен простой пример.
XAML:
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="378" Width="472">
<Canvas>
<MediaElement LoadedBehavior="Play" Name="myME" Source="c:\\1.wmv" Width="320" Height="240" Canvas.Left="0" Canvas.Top="0">
</MediaElement>
</Canvas>
</Window>
C #
using System;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
namespace tests
{
/// <summary>
/// Interaction logic for Window1.xaml
/// </summary>
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
this.MyMedia1.Clip =
new RectangleGeometry( new Rect(0, 0, myME.Width/3, myME.Height));
}
}
}