-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathBasicCapture.xaml
More file actions
85 lines (79 loc) · 4.91 KB
/
BasicCapture.xaml
File metadata and controls
85 lines (79 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!--
//*********************************************************
//
// 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">
<TextBlock x:Name="InputTextBlock1" TextWrapping="Wrap" 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>
</Grid>
<Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="0">
<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="1">
<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>
<StackPanel Orientation="Horizontal" Margin="0,10,0,0" Grid.Row="2">
<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 Margin="10,0,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" HorizontalAlignment='Center' VerticalAlignment='Center' TextAlignment='Center' Text='Captured Video' />
<Canvas x:Name='playbackCanvas1' Width='320' Height ='240' Background="Gray">
<MediaElement x:Name='playbackElement1' Width="320" Height="240" />
</Canvas>
</StackPanel>
<StackPanel Margin="10,0,0,0">
<TextBlock Style="{StaticResource BasicTextStyle}" HorizontalAlignment='Center' VerticalAlignment='Center' TextAlignment='Center' Text='Captured Images' />
<Canvas x:Name="imageCanvas1" Width='320' Height ='240' Background="Gray">
<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="DefaultLayout"/>
<VisualState x:Name="Below768Layout"/>
</VisualStateGroup>
</VisualStateManager.VisualStateGroups>
</Grid>
</common:LayoutAwarePage>