第28回codeseek勉強会 WPF で簡単ビデオ再生 2008年5月27日(火)

Slides:



Advertisements
Similar presentations
マイクロソフトがホスティングする拡張性に優れたサービス ベース アプリケーション プラットフォーム.
Advertisements

この部分こそが必 要とされている ! Runtime 自身と Expression が カバーする!
Windows Azure ハンズオン トレーニング Windows Azure Web サイト入門.
Oscar Koenders Principal Group Program Manager Microsoft Corporation
第27回codeseek勉強会 ZAM3D で簡単3D XAML プログラミング
D2-301 現時点の本資料は 完成版のスライドではありません。
MSON-B2 .NET Framework Web アプリケーション開発
3/1/2017 1:30 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Consumer Channels and Central Marketing Group
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
C# Programming .NET / C# Group 検索ワードでみる C#の困り事とその対策
3/2/2017 9:01 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Phone アプリケーションでの データ視覚化
3/3/2017 8:49 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
3/4/ :37 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Expression Blend 3で始めるSilverlight 3アプリケーション開発
ParadoxのLiveScripting事情
Using connected devices in Metro style apps Metro スタイル アプリで デバイスを使用する
3/11/2017 7:02 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
WindowsストアアプリをC++/CXで作る
Windows Summit /13/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
MIX 09 3/14/2017 9:51 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Consumer Channels and Central Marketing Group
3/17/2017 1:49 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
データはお客様に属し、かつ、コントロール可能
HP ProLiant DL980 G7 SQL Server 2008 R2 NUMA 環境 ベンチマークテスト結果報告書
ビジネスにおける オープンソースの利用価値
XAML の勉強不要! WPF アプリケーションは作れます
大学におけるクラウド活用の 最新動向と先進ソリューションの 事例
3/21/2017 3:39 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Using tiles and notifications タイルと通知の使用
[コース: A1] .NET Framework の基礎
Windows Summit /6/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /6/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /8/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /9/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Microsoft Consumer Channels and Central Marketing Group
9/17/ :05 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
9/17/ :17 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Summit /11/7 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Microsoft Partner Network Office 365 社内使用ライセンスの有効化
Microsoft Consumer Channels and Central Marketing Group
11/9/2018 3:35 AM Windows Azure Platform ハンズオン トレーニング Windows Azure アプリケーション開発概要 ~ Windows Azure 入門編 ~ © 2007 Microsoft Corporation. All rights reserved.
Windows Summit /22/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Windows Summit /11/23 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Windows Summit /24/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Expression Blend 3で始めるSilverlight 3アプリケーション開発
Chad Siefert Senior Test Lead Microsoft Corporation
Windows Azure 通知ハブ.
12/9/ :14 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Summit /31/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
suppose to be expected to be should be
Microsoft Visual Studio 2005 Tools for
Windows Summit /21/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /22/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
MIX 09 2/23/2019 1:22 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Max Morris Principal Program Manager Microsoft Corporation
Windows Summit /24/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
主要関係者の特定用テンプレート Windows 10 and Office 365 導入ステップ 2/24/2019
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
~ 第5回 認証のためのプロキシー Web Application Proxy
Windows Summit /4/10 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Craig Rowland Senior Program Manager Microsoft Corporation
Microsoft Consumer Channels and Central Marketing Group
Windows Summit 2010 © 2010 Microsoft Corporation.All rights reserved.Microsoft、Windows、Windows Vista およびその他の製品名は、米国 Microsoft Corporation の米国およびその他の国における登録商標または商標です。
Windows Summit /22/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
MIX 09 8/2/2019 8:06 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Azure メディアサービス
Presentation transcript:

第28回codeseek勉強会 WPF で簡単ビデオ再生 2008年5月27日(火) 2/28/2017 1:35 AM 第28回codeseek勉強会 WPF で簡単ビデオ再生 2008年5月27日(火) 宇宙仮面 / C# MVP 2007.10 – 2008.10 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

AGENDA 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Agenda WPFで簡単ビデオ再生 自己紹介 イントロダクション MediaElement MediaPlayer 2/28/2017 1:35 AM Agenda WPFで簡単ビデオ再生 自己紹介 イントロダクション MediaElement MediaPlayer 独立モードとクロックモード ビデオキャプチャ Q&A © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

GOAL 今日帰るときには・・・ WPF のビデオの概要 MediaElement の使い方、特徴を理解 2/28/2017 1:35 AM GOAL 今日帰るときには・・・ WPF のビデオの概要 MediaElement の使い方、特徴を理解 MediaPlayer の使い方、特徴を理解 簡単なビデオプレーヤーが作れる © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

自己紹介 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

自己紹介 なんで、そんなことしているの? 2000 ごろは、Java/Unix 系でした Windows 系の開発をしたことがなかったので 2/28/2017 1:35 AM 自己紹介 なんで、そんなことしているの? 2000 ごろは、Java/Unix 系でした Microsoft は嫌いだったので、2000-2002 ぐらいまで、Java/Unix 系で Web Server を立てて、HPを作っていた。 日曜管理者なので、カーネルのメインテナンスに疲れ果てた。 少し金を払ってもいいから、楽にサーバーを運用したかったので、 Windows 系に乗り換えた。 Windows 系の開発をしたことがなかったので Visual Studio 2002 C# Beta が出たので、触ってみた。 すげー!! コミュニティ いろいろな素晴らしい人と出会える。 面白い!理屈はいらないでしょ。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

自己紹介 MVPを受賞したきっかけは? 2002年に Visual Studio 2002 Beta が出た 2/28/2017 1:35 AM 自己紹介 MVPを受賞したきっかけは? 2002年に Visual Studio 2002 Beta が出た Beta はタダだったので、使ってみた。 .NET/C# のすごさに触発された。 わからないことがいろいろあるが、C#/.NET 関連の日本語 HP がほとん どなかった。 せっかく調べたのに、忘れてしまうともったいなので、少しづつまとめて、 宇宙仮面の C# プログラミングというページを作成していた。 すこしづつ C# ユーザーが増え、掲示板にも書きこまれるようになった。 .NET/C# Group を開始 どなたかが、MVPに推薦してくれたらしい。 最初、マルチ商法みたいで怖かったから、テキトーにあしらっていた。 Microsoft KK から直接説明があったので、お受けすることに。 2003/10 MVP for Visual Developer C# 受賞 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

イントロダクション 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM WPF でビデオ・音声メディアを再生 MediaElement と MediaPlayer WPF でビデオ・音声メディアを再生するには、 MediaElement、またはMediaPlayerを使います。 それぞれ特徴があるので、しっかり押さえておき たい。 MediaElement は、WPFに統合されているので、アルファブレン ディングや3D の表面にレンダリングも可能 MediaPlayer には直接的なビジュアル表現がないので、レイアウト 上は直接使えません。しかし、Windows Media Player ランタイ ムを起動する必要がないため、高速に起動できます。また、ビジュ アル表現がないので、音声の再生にも適しています。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MediaElement 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なビデオ再生1 MediaElementにより、単純にビデオを再生 2/28/2017 1:35 AM 簡単なビデオ再生1 MediaElementにより、単純にビデオを再生 <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/prese ntation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication3.Window1" x:Name="Window" Title="Window1" Width="320" Height="240" xmlns:d="http://schemas.microsoft.com/expression/blend/200 8" xmlns:mc="http://schemas.openxmlformats.org/markup- compatibility/2006" mc:Ignorable="d"> <Grid> <MediaElement Source="Test.wmv" LoadedBehavior="Play"/> </Grid> </Window> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO1 MediaElementにより、 単純にビデオを再生 2/28/2017 1:35 AM demo DEMO1 MediaElementにより、 単純にビデオを再生 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM 簡単なビデオ再生2 Expression Blend によるWPF プロジェクトの自動生成 Expression Blend を使用してメディアを再生する WPF プロジェクトを簡単に作ることができます。 1. WMVなどのメディアをプロジェクトに追加する。 2. WMVファイルをダブルクリックするか、フォー ム上に Drag & Drop する。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なビデオ再生2 Expression Blend によるWPF プロジェクトの自動生成 2/28/2017 1:35 AM 簡単なビデオ再生2 Expression Blend によるWPF プロジェクトの自動生成 <Window ・・・> <Window.Resources> <Storyboard x:Key="Test_wmv"> <MediaTimeline Source="Test.wmv" BeginTime="00:00:00" Storyboard.TargetName="Test_wmv" d:DesignTimeNaturalDuration="233.129"/> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="FrameworkElement.Loaded"> <BeginStoryboard Storyboard="{StaticResource Test_wmv}"/> </EventTrigger> </Window.Triggers> <Grid x:Name="LayoutRoot"> <MediaElement Margin="62,46,255,78" x:Name="Test_wmv" Stretch="Fill"/> </Grid> </Window> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO2 Expression Blend による 単純にビデオを再生 2/28/2017 1:35 AM demo DEMO2 Expression Blend による 単純にビデオを再生 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

単純なビデオ再生3 Silverlight2 によるWPF プロジェクトの自動生成 2/28/2017 1:35 AM 単純なビデオ再生3 Silverlight2 によるWPF プロジェクトの自動生成 ストリーボードなしのシンプルな XAML が生成されます。 Silverlight2 では、まだ MediaTimeline がサポートされていません。 <UserControl xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="SilverlightApplication6.Page" Width="320" Height="240"> <Grid x:Name="LayoutRoot" Background="White" > <MediaElement x:Name="Test_wmv" Source="Test.wmv" Stretch="Fill"/> </Grid> </UserControl> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO3 Silverlight2 による ビデオ再生 2/28/2017 1:35 AM demo DEMO3 Silverlight2 による ビデオ再生 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM 簡単なビデオ再生4 WPF コントロールの内部にビデオを埋め込む MediaElement コントロールは System.Windows.UIElement クラスから継承さ れているので、他の UIElement コントロールを 配置できるところであればどこでも配置できます。 <Button Click="Button_Click"> <MediaElement x:Name="Test_wmv“ LoadedBehavior="Manual” Source="Test.wmv" Stretch="Fill“ /> </Button> ----------- // C# 再生用コード this.Test_wmv.Play();    © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO4 WPF コントロールの内部に ビデオを埋め込む 2/28/2017 1:35 AM demo DEMO4 WPF コントロールの内部に ビデオを埋め込む © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なビデオ再生5 MediaElement の MediaOpened でプログレス バーの最大値を設定 2/28/2017 1:35 AM 簡単なビデオ再生5 プログレスバーの表示 MediaElement の MediaOpened でプログレス バーの最大値を設定 Storyboard の CurrentTimeInvalidated でプロ グレスバーの値を設定する <MediaElement Name="myMedia" MediaOpened="myMedia_MediaOpened"/> … <Storyboard Storyboard.TargetName="myMedia" CurrentTimeInvalidated="Storyboard_CurrentTimeInvalidated"> <MediaTimeline Source="Test.wmv" x:Name="mTimeline" BeginTime="00:00:00" Duration="00:10:05" /> </Storyboard> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なサンプル5 C# 実装部分 プログレスバーの表示 2/28/2017 1:35 AM 簡単なサンプル5 プログレスバーの表示 C# 実装部分 private void Storyboard_CurrentTimeInvalidated(…) { this.progressBar1.Value = myMedia.Position.TotalMilliseconds; } private void myMedia_MediaOpened(...){ this.progressBar1.Maximum = myMedia.NaturalDuration.TimeSpan.TotalMilliseconds; © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo DEMO5 プログレスバーの表示 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なビデオ再生6 再生、停止、一時停止、再生位置の変更、ボリュームの変更、再生スピードの調整 注意: 2/28/2017 1:35 AM 簡単なビデオ再生6 再生、停止、一時停止、再生位置の変更、ボリュームの変更、再生スピードの調整 注意: メディアを対話的に停止、一時停止、および再生できるようにするには、 MediaElement の LoadedBehavior プロパティを Manual に設 定する必要があります。 再生: myMediaElement.Play(); 停止: myMediaElement.Stop(); 一時停止: myMediaElement.Pause(); 再生位置の変更: TimeSpan ts = new TimeSpan(0, 0, 0, 0, SliderValue); myMediaElement.Position = ts; ボリュームの変更: myMediaElement.Volume = (double)volumeSlider.Value; 再生スピードの調整: myMediaElement.SpeedRatio = (double)speedRatioSlider.Value; © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO6 再生、停止、一時停止、再生位置の変更、ボリュームの変更、再生スピードの調整 2/28/2017 1:35 AM demo DEMO6 再生、停止、一時停止、再生位置の変更、ボリュームの変更、再生スピードの調整 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM MediaElement 使用時の注意 再生時の遅延対策 MediaElement を使用した場合、Windows Media Player ランタイムを起動する必要があるため、メ ディアを最初に再生するときに、遅延が生じる場合 があります。 このため、メディア ファイルとユーザー イベント やアニメーションと正確に同期を取って再生するこ とができません。 対策 1. メディア ファイルを事前に読み込み、使用準備が整うまで一時停 止状態にしておく。 2. <Storyboard SlipBehavior="Slip"> を指定します。すると、メディアの再生が開始するまで、アニメー ションが停止してくれます。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

簡単なビデオ再生6 ビデオを 3D の表面にマップする 2/28/2017 1:35 AM 簡単なビデオ再生6 ビデオを 3D の表面にマップする ModelVisual3D の中で、VisualBrush の MediaElement ソースにメ ディアファイルを指定します。 <GeometryModel3D.Material> <DiffuseMaterial> <DiffuseMaterial.Brush> <VisualBrush> <VisualBrush.Visual> <MediaElement Source="Test.wmv" /> </VisualBrush.Visual> </VisualBrush> </DiffuseMaterial.Brush> </DiffuseMaterial> </GeometryModel3D.Material> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo DEMO7 ビデオを 3D の表面にマップする 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MediaPlayer 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MediaPlayer によるメディアの再生 2/28/2017 1:35 AM MediaPlayer によるメディアの再生 MediaPlayer の用途 メディアを再生するもう一つの方法として、 MediaPlayer があります。 MediaElement は、基本的に MediaPlayer クラ スのラッパーなので、MediaElement で実現でき ることは MediaPlayer で実現できます。 MediaPlayer は - 音楽を再生する - より複雑な処理 に使用します。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

MediaPlayer によるメディアの再生 2/28/2017 1:35 AM MediaPlayer によるメディアの再生 主なプロパティ MediaPlayerのプロパティや、イベントを設定することに より、たとえば次のような操作が可能です。 メディア ファイルの位置を取得または設定 Position プロ パティに TimeSpan オブジェクトを設定します。 例 バッファリングの進行状況 BufferingProgress プロパティ 再生の進行状況 DownloadProgress プロパティ オーディオ コントロール Balance プロパティ、 Volume プロパティを設定 メディアの開始を知る MediaOpened イベント メディアの終了を知る MediaEnded イベント © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

音楽を再生する ビデオを 3D の表面にマップする 2/28/2017 1:35 AM 音楽を再生する ビデオを 3D の表面にマップする WAV オーディオだけの再生であれば、 System.Media.SoundPlayer クラスが利用できます。 いろいろな種類の音楽を再生するには、MediaPlayer クラ スを使用するのが良いでしょう。 MediaPlayer mp = new MediaPlayer(); Try { mp.Open(new Uri(@"..\..\Test.wma", UriKind.Relative)); mp.Play(); } catch (Exception ex) MessageBox.Show(ex.Message); © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

ビデオを再生する MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する 2/28/2017 1:35 AM ビデオを再生する MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する <Rectangle Stroke="Black" MouseDown="OnClick1" …> <Rectangle.RenderTransform> <TransformGroup> … </TransformGroup> </Rectangle.RenderTransform> <Rectangle.Fill> <DrawingBrush> <DrawingBrush.Drawing> <VideoDrawing x:Name="MyVideoDrawing“… /> </DrawingBrush.Drawing> </DrawingBrush> </Rectangle.Fill> </Rectangle> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

ビデオを再生する MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する 2/28/2017 1:35 AM ビデオを再生する MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する C# 実装部分 void OnClick1(object sender, RoutedEventArgs e) { MediaPlayer MyPlayer = new MediaPlayer(); MyPlayer.Open(new Uri(@“..\..\Test.wmv”, UriKind.Relative)); MyVideoDrawing.Player = MyPlayer; MyPlayer.Play(); } © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO8 MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する 2/28/2017 1:35 AM demo DEMO8 MediaPlayer, DrawingBrush を使って、ビデオをコントロールに描画する © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

ウェットフロア 2つのビジュアルに同時プレイ 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM ウェットフロア C# 実装部分 void OnLoaded(object sender, RoutedEventArgs e) { MediaPlayer MyPlayer = new MediaPlayer(); MyPlayer.Open(new Uri(@"..\..\Test.wmv", UriKind.Relative)); MyVideoDrawing.Player = MyPlayer; MyVideoDrawing1.Player = MyPlayer; MyPlayer.Play(); } © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

DEMO9 MediaPlayer ウェットフロア 2/28/2017 1:35 AM demo DEMO9 MediaPlayer ウェットフロア © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

独立モードと クロックモード 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

独立モードとクロックモードとは 独立モードとクロックモード 2/28/2017 1:35 AM 独立モードとクロックモードとは 独立モードとクロックモード MediaElement、および MediaPlayer は、独立モードとク ロック モードの2つのモードがあります。 通常の再生だけであれば、独立モードで OK です。 独立モード <MediaElement Source="Test.wmv" Width="320" Height="240" LoadedBehavior="Play"/> クロックモード Expression Blend で、メディアを追加した場合、クロック モードで WPF が生成されます。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM 独立モード Clock が null の場合 MediaElement はイメージに似ており、直接 Source URI を 指定できます。 標準のメディアを再生および制御する場合、Storyboard や MediaTimeline を扱う必要はありません。 通常の再生だけであれば、独立モードで OK です。 Clock が null の場合、メディア オブジェクトは独立モード です。 特徴 - メディアの Uri を直接指定することができます。 - メディアの再生を直接制御できます。 - メディアの Position プロパティと SpeedRatio プロパ ティを変更できます。 独立モードの例 <MediaElement Source="Test.wmv" Width="320" Height="240" LoadedBehavior="Play"/> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

クロックモード Clock が Null ではない場合 2/28/2017 1:35 AM クロックモード Clock が Null ではない場合 MediaElement は、MediaTimeline によって、メディアの再 生が実行されます。 特徴 - メディアの Uri は、MediaTimeline を通じて間接的に設 定されます。 - メディアの再生をクロックで制御できます。メディア オ ブジェクトのコントロール メソッドは使用できません。 Expression Blend で、メディアを追加した場合、クロッ クモードで WPF が生成されます。 ClockController プロパティを使用すれば、対話形式でク ロックを開始、 一時停止、再開、シーク、区間の最後ま での前進、停止ができます。 © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM クロックモード クロックモード private void Button_Click(object sender, RoutedEventArgs e) { this.Test_wmv.Clock.Controller.Pause(); // クロックのPause } private void Button_Click_1(object sender, RoutedEventArgs e) { this.Test_wmv.Clock.Controller.Seek(new TimeSpan(0, 0, 30), TimeSeekOrigin.BeginTime); // クロックをシーク this.Test_wmv.Clock.Controller.Resume(); private void Window_Loaded(object sender, RoutedEventArgs e) { MediaTimeline mTimeline = new MediaTimeline(new Uri(@"..\..\Test.wmv", UriKind.Relative)); MediaClock mClock = mTimeline.CreateClock(); this.Test_wmv.Clock = mClock; this.Test_wmv.Clock.Controller.Begin(); © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo DEMO 10 クロックモード 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

ビデオキャプチャ 第28回codeseek勉強会 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM ビデオキャプチャ <Rectangle Stroke="Black" MouseLeftButtonDown="Rectangle_MouseDown" RenderTransformOrigin="0.5,0.5" Margin="102,11,14,0" Height="89.305" VerticalAlignment="Top"> <Rectangle.RenderTransform> <TransformGroup> </TransformGroup> </Rectangle.RenderTransform> <Rectangle.Fill> <DrawingBrush> <DrawingBrush.Drawing> <VideoDrawing x:Name="MyVideoDrawing…/> </DrawingBrush.Drawing> </DrawingBrush> </Rectangle.Fill> </Rectangle> <Image Height="30" HorizontalAlignment="Left“ Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="72" /> © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2/28/2017 1:35 AM ビデオキャプチャ C# 実装部分 MediaPlayer MyPlayer = new MediaPlayer(); private void Rectangle_MouseDown(…) { MyPlayer.Open(new Uri(@"..\..\Test.wmv", UriKind.Relative)); MyVideoDrawing.Player = MyPlayer; MyPlayer.Play(); } private void button1_Click(…) { RenderTargetBitmap rtb = new RenderTargetBitmap((int)image1.Width, (int)image1.Height, 1 / 200, 1 / 200, PixelFormats.Pbgra32); DrawingVisual dv = new DrawingVisual(); DrawingContext dc = dv.RenderOpen(); dc.DrawVideo(MyPlayer, new Rect(0, 0, (int)image1.Width, (int)image1.Height)); dc.Close(); rtb.Render(dv); this.image1.Source = BitmapFrame.Create(rtb); using (FileStream stream = new FileStream("capture.png", FileMode.Create)) { PngBitmapEncoder encoder = new PngBitmapEncoder(); encoder.Frames.Add(BitmapFrame.Create(rtb)); encoder.Save(stream); © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

demo DEMO 11 ビデオキャプチャ 2/28/2017 1:35 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Resources 宇宙仮面の C# http://uchukamen.com WPF を使ってコントロールと 3D の表面にビデオを追加する http://msdn.microsoft.com/ja-jp/magazine/cc163455.aspx MSDN MediaElement クラス http://msdn.microsoft.com/ja-jp/library/system.windows.controls.mediaelement.aspx