8.0 相機和照片: 通過 PhotoCaptureDevice 捕獲照片
介紹
與眾不同 windows phone 8.0 之 相機和照片
通過 PhotoCaptureDevice 捕獲照片
樣本
示範 PhotoCaptureDevice(wp8)的應用
CameraAndPhoto/PhotoCaptureDeviceDemo.xaml
<phone:PhoneApplicationPage x:Class="Demo.CameraAndPhoto.PhotoCaptureDeviceDemo" 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> <Image Name="imgPreview" Width="240" Height="180" /> </StackPanel> <StackPanel Orientation="Horizontal" Margin="0 50 0 0"> <Button Name="btnCapture" Content="照相" Click="btnCapture_Click" /> <Button Name="btnFocus" Content="自動對焦" Click="btnFocus_Click" /> </StackPanel> <TextBlock x:Name="lblMsg" TextWrapping="Wrap" Margin="0 10 0 0" /> </StackPanel> </Grid> </phone:PhoneApplicationPage>