- 멀티미디어 데이터 재생가능한 컨트롤입니다.
추가 설명 : VideoBrush
- VideoBrush 를 사용하여 UI 요소에 채우기 등으로 표현 가능함
MainPage.xaml |
[그림 21-1] <Grid x:Name="LayoutRoot" Background="White"> <!--상대경로--> <StackPanel Orientation="Horizontal"> <MediaElement x:Name="myVideo" Source="Video/Silverlight.wmv" AutoPlay="False" IsMuted="False"> </MediaElement> <StackPanel> <Button x:Name="btnStart" Content="재c생íy"></Button> <Button x:Name="btnStop" Content="중©¬지o"></Button> </StackPanel> </StackPanel> </Grid> |
MainPage.xaml.cs |
public MainPage() { InitializeComponent(); btnStart.Click += new RoutedEventHandler(btnStart_Click); btnStop.Click += new RoutedEventHandler(btnStop_Click); } void
btnStop_Click(object sender, RoutedEventArgs e) { myVideo.Stop(); //중지 } void
btnStart_Click(object sender, RoutedEventArgs e) { //myVideo.AutoPlay
= true; myVideo.Play(); //재생 } |
'Silverlight' 카테고리의 다른 글
23.SilverLight3 - Geometry : EllipseGeometry (0) | 2009.11.26 |
---|---|
22.SilverLight3 - Geometry : LineGeometry (0) | 2009.11.26 |
20.SilverLight3 - Image (0) | 2009.11.26 |
19.SilverLight3 - Shape - Path (0) | 2009.11.25 |
18.SilverLight3 - Shape - Polygon ( 닫혀있는 모양 ) (0) | 2009.11.25 |
Comments