读书人

[攒分贴]刚刚开发的silverlight视频播

发布时间: 2012-11-03 10:57:43 作者: rapoo

[攒分贴]刚开发的silverlight视频播放器[源码+效果图]


源码

XAML code
<UserControl xmlns:my="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Extended"  x:Class="TstringMovie.TstringMovieControl"    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"      Width="600" Height="400" x:Name="GlobeFrame">    <Grid x:Name="Frame" Width="Auto" Height="Auto">        <!--FrameIframe-->        <Rectangle Fill="#FF1D1D1D" Stroke="#FF2A2A29" RadiusX="10" RadiusY="10" Margin="0,0,0,0" x:Name="FrameIframe" />        <!--播放区框架-->        <Grid Margin="10,30,10,11" x:Name="播放区框架">            <MediaElement x:Name="TstringMovieObject" Margin="2,2,2,40" Source="222.wmv" Canvas.ZIndex="10"/>            <!--PlayScreen-->            <Rectangle Fill="#FF000000" Stroke="#FF2A2A29" StrokeThickness="1" RadiusX="0" RadiusY="0" Margin="0,0,0,39" x:Name="PlayScreen" />            <!--ControlPanel-->            <Rectangle Fill="#FF1D1D1D" Stroke="#FF2A2A29" StrokeThickness="1" RadiusX="0" RadiusY="0" x:Name="ControlPanel" VerticalAlignment="Bottom" Height="40" />            <Rectangle Fill="#FF1D1D1D" Stroke="#FF2A2A29" StrokeThickness="1" RadiusX="0" RadiusY="0" Margin="55,0,55,0" x:Name="MovieBg" VerticalAlignment="Bottom" Height="40"/>            <!--播放进度背景-->            <Rectangle Canvas.ZIndex="9" Fill="#FFFFFFFF" Stroke="#00A5A5A5" StrokeThickness="0" RadiusX="5" RadiusY="5" Margin="60,0,60,10" x:Name="TstringSliderBg" VerticalAlignment="Bottom" Height="20" ToolTipService.ToolTip="影片总时长"/>            <!--播放进度-->            <Rectangle Canvas.ZIndex="10" Fill="#FF3D3838" Stroke="#00A5A5A5" StrokeThickness="2" RadiusX="5" RadiusY="5" HorizontalAlignment="Left" Margin="60,0,0,10" x:Name="TstringPlayState" VerticalAlignment="Bottom" Height="20" ToolTipService.ToolTip="播放进度"/>            <TextBlock x:Name="ControlPlay" Cursor="Hand" HorizontalAlignment="Left" Margin="10,0,0,10" VerticalAlignment="Bottom" Width="Auto" Height="Auto" FontSize="16" Foreground="#FFFFFFFF" Text="播放" TextWrapping="Wrap"/>            <TextBlock x:Name="ControlFull" Cursor="Hand" HorizontalAlignment="Right" Margin="0,0,10,10" VerticalAlignment="Bottom" Width="Auto" Height="Auto" FontSize="16" Foreground="#FFFFFFFF" Text="全屏" TextWrapping="Wrap"/>


晕倒,内容太长,一次发不完


说明
开发工具:Microsoft Expression Blend,Microsoft Visual Studio 2008,c#
布局基本上都是相对位置,设置总长宽则所有控件均按比例绽放

[解决办法]
xue xi

读书人网 >CAD教程

热点推荐