我有一个wmv文件。在xaml源文件中,ı正在将此wmv文件用作Media元素。只是我想使用显示字节数组而不是此wmv文件路径。我该怎么做 ?
这是xaml部分
<MediaElement Name="VideoControl" Source= "Content\\Images\\PutBaggage.wmv" Width="902" Height="650" Canvas.Left="63" Canvas.Top="282">
<MediaElement.Triggers>
<EventTrigger RoutedEvent="MediaElement.Loaded">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<MediaTimeline Source="Content\\Images\\PutBaggage.wmv" Storyboard.TargetName="VideoControl" RepeatBehavior="Forever" />
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</MediaElement.Triggers>
</MediaElement>
这是从wmv到字节的对话:
protected override void BasePage_Loaded(object sender, RoutedEventArgs e)
{
String path = @"Content\\Images\\PutBaggage.wmv";
FileStream filer = File.OpenRead(path);
BinaryReader br = new BinaryReader(filer);
byte[] file = br.ReadBytes(99999999);
base.BasePage_Loaded(sender, e);
}