8.0 相機和照片: 通過 AudioVideoCaptureDevice 捕獲視頻和音頻
介紹
與眾不同 windows phone 8.0 之 相機和照片
通過 AudioVideoCaptureDevice 捕獲視頻和音頻
樣本
示範 AudioVideoCaptureDevice(wp8)的應用
CameraAndPhoto/AudioVideoCaptureDeviceDemo.xaml
<phone:PhoneApplicationPage x:Class="Demo.CameraAndPhoto.AudioVideoCaptureDeviceDemo" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" FontFamily="{StaticResource PhoneFontFamilyNormal}" FontSize="{StaticResource PhoneFontSizeNormal}" Foreground="{StaticResource PhoneForegroundBrush}" SupportedOrientations="Portrait" Orientation="Portrait" mc:Ignorable="d" shell:SystemTray.IsVisible="True"> <Grid x:Name="LayoutRoot" Background="Transparent"> <StackPanel> <StackPanel Orientation="Horizontal"> <Canvas Width="240" Height="180" RenderTransformOrigin="0.5 0.5"> <Canvas.Background> <VideoBrush x:Name="videoBrush" /> </Canvas.Background> <Canvas.RenderTransform> <RotateTransform x:Name="rt" /> </Canvas.RenderTransform> </Canvas> <MediaElement Name="mediaElement" Width="240" Height="180" /> </StackPanel> <StackPanel Orientation="Horizontal" Margin="0 50 0 0"> <Button Name="btnCapture" Content="錄影" Click="btnCapture_Click" /> <Button Name="btnStop" Content="停止" Click="btnStop_Click" IsEnabled="False" /> <Button Name="btnPlay" Content="播放" Click="btnPlay_Click" /> </StackPanel> <TextBlock x:Name="lblMsg" TextWrapping="Wrap" Margin="0 10 0 0" /> </StackPanel> </Grid> </phone:PhoneApplicationPage>