88 lines
4.9 KiB
XML
88 lines
4.9 KiB
XML
<!--
|
|
//*********************************************************
|
|
//
|
|
// Copyright (c) Microsoft. All rights reserved.
|
|
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
|
|
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
|
|
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
|
|
//
|
|
//*********************************************************
|
|
-->
|
|
|
|
<common:LayoutAwarePage
|
|
x:Class="SDKSample.MediaCapture.BasicCapture"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:local="using:$rootsnamespace$"
|
|
xmlns:common="using:SDKSample.Common"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
mc:Ignorable="d">
|
|
|
|
<Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<Grid x:Name="Input" Grid.Row="0">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock x:Name="InputTextBlock1" TextWrapping="Wrap" Grid.Row="0" Style="{StaticResource BasicTextStyle}" HorizontalAlignment="Left" >
|
|
This scenario demonstrates how to use the MediaCapture API to preview the camera stream, record a video, and take a picture using default initialization settings.
|
|
You can also adjust the brightness and contrast.
|
|
</TextBlock>
|
|
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="1">
|
|
<Button x:Name="btnStartDevice1" Click="btnStartDevice_Click" IsEnabled="true" Margin="0,0,10,0">StartDevice</Button>
|
|
<Button x:Name="btnStartPreview1" Click="btnStartPreview_Click" IsEnabled="true" Margin="0,0,10,0">StartPreview</Button>
|
|
<Button x:Name="btnStartStopRecord1" Click="btnStartStopRecord_Click" IsEnabled="false" Margin="0,0,10,0">StartRecord</Button>
|
|
<Button x:Name="btnTakePhoto1" Click="btnTakePhoto_Click" IsEnabled="false" Margin="0,0,10,0">TakePhoto</Button>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="2">
|
|
<TextBlock TextWrapping="Wrap" Text="Brightness" Style="{StaticResource BasicTextStyle}" Margin="0,0,10,0" VerticalAlignment="Center"/>
|
|
<Slider x:Name="sldBrightness" IsEnabled="False" ValueChanged="sldBrightness_ValueChanged" Width="207" Margin="0,0,10,0"/>
|
|
<TextBlock TextWrapping="Wrap" Text="Contrast" Style="{StaticResource BasicTextStyle}" Margin="0,0,10,0" VerticalAlignment="Center" />
|
|
<Slider x:Name="sldContrast" IsEnabled="False" ValueChanged="sldContrast_ValueChanged" Width="207" Margin="0,0,10,0"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
|
|
<StackPanel Orientation="Horizontal" Margin="0,10,0,0">
|
|
<StackPanel>
|
|
<TextBlock Style="{StaticResource BasicTextStyle}" HorizontalAlignment='Center' VerticalAlignment='Center' TextAlignment='Center' Text='Preview' />
|
|
<Canvas x:Name="previewCanvas1" Width="320" Height="240" Background="Gray">
|
|
<CaptureElement x:Name="previewElement1" Width="320" Height="240" />
|
|
</Canvas>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<TextBlock Style="{StaticResource BasicTextStyle}" HorizontalAlignment='Center' VerticalAlignment='Center' TextAlignment='Center' Text='Captured Video' />
|
|
<Canvas x:Name='playbackCanvas1' Width='320' Height ='240' >
|
|
<MediaElement x:Name='playbackElement1' Width="320" Height="240" />
|
|
</Canvas>
|
|
</StackPanel>
|
|
<StackPanel>
|
|
<TextBlock Style="{StaticResource BasicTextStyle}" HorizontalAlignment='Center' VerticalAlignment='Center' TextAlignment='Center' Text='Captured Images' />
|
|
<Canvas x:Name="imageCanvas1" Width='320' Height ='240' >
|
|
<Image x:Name="imageElement1" Width="320" Height="240"/>
|
|
</Canvas>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
|
|
</Grid>
|
|
|
|
<!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
|
|
<VisualStateManager.VisualStateGroups>
|
|
<VisualStateGroup>
|
|
<VisualState x:Name="FullScreenLandscape"/>
|
|
<VisualState x:Name="Filled"/>
|
|
<VisualState x:Name="FullScreenPortrait"/>
|
|
<VisualState x:Name="Snapped"/>
|
|
</VisualStateGroup>
|
|
</VisualStateManager.VisualStateGroups>
|
|
</Grid>
|
|
|
|
</common:LayoutAwarePage>
|