|
1 | 1 | <!-- |
2 | | - *@@@+++@@@@****************************************************************** |
3 | | - |
4 | | - Microsoft Windows Media Foundation |
5 | | - Copyright (C) Microsoft Corporation. All rights reserved. |
6 | | - |
7 | | - *@@@+++@@@@****************************************************************** |
| 2 | +*@@@+++@@@@****************************************************************** |
| 3 | +
|
| 4 | +Microsoft Windows Media Foundation |
| 5 | +Copyright (C) Microsoft Corporation. All rights reserved. |
| 6 | +
|
| 7 | +*@@@+++@@@@****************************************************************** |
8 | 8 | --> |
9 | 9 | <Page |
10 | 10 | x:Class="SnapCandy.MainPage" |
11 | 11 | xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
12 | 12 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
13 | | - xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
14 | 13 | xmlns:local="using:SnapCandy" |
| 14 | + xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
15 | 15 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
16 | 16 | mc:Ignorable="d"> |
17 | 17 |
|
18 | 18 | <Page.Resources> |
19 | | - <SolidColorBrush |
20 | | - x:Key="TranslucentBlackBrush" |
21 | | - Opacity="0.3" |
22 | | - Color="Black" /> |
| 19 | + <SolidColorBrush x:Key="TranslucentBlackBrush" Color="Black" Opacity="0.3"/> |
23 | 20 | <Style x:Key="TextBlockStyling" TargetType="TextBlock"> |
24 | | - <Setter Property="Foreground" Value="Black" /> |
| 21 | + <Setter Property="Foreground" Value="Black"/> |
25 | 22 | </Style> |
26 | 23 | </Page.Resources> |
27 | 24 |
|
28 | 25 | <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> |
29 | 26 |
|
30 | 27 | <Grid> |
31 | 28 | <Grid.RowDefinitions> |
32 | | - <RowDefinition Height="80" /> |
33 | | - <RowDefinition Height="300*" /> |
34 | | - <RowDefinition Height="30" /> |
| 29 | + <RowDefinition Height="80"/> |
| 30 | + <RowDefinition Height="300*"/> |
| 31 | + <RowDefinition Height="30"/> |
35 | 32 | </Grid.RowDefinitions> |
36 | 33 |
|
37 | | - <!-- Status and result display --> |
38 | | - <StackPanel |
39 | | - x:Name="UIStatusPanel" |
40 | | - Grid.Row="0" |
41 | | - VerticalAlignment="Top" |
42 | | - Background="#BFFFFFFF"> |
| 34 | + <!--Status and result display--> |
| 35 | + <StackPanel x:Name="UIStatusPanel" Background="#BFFFFFFF" VerticalAlignment="Top" Grid.Row="0"> |
43 | 36 | <ContentControl Name="UIModelControls"> |
44 | 37 | <StackPanel Orientation="Horizontal"> |
45 | | - <ToggleSwitch |
46 | | - Name="UIToggleInferenceDevice" |
47 | | - Margin="10,0,0,0" |
48 | | - IsOn="True" |
49 | | - OffContent="CPU" |
50 | | - OnContent="GPU" |
51 | | - Toggled="UIToggleInferenceDevice_Toggled" /> |
| 38 | + <ToggleSwitch Name="UIToggleInferenceDevice" |
| 39 | + OnContent="GPU" |
| 40 | + OffContent="CPU" |
| 41 | + IsOn="True" |
| 42 | + Toggled="UIToggleInferenceDevice_Toggled" |
| 43 | + Margin="10,0,0,0"/> |
52 | 44 |
|
53 | 45 | <ListBox Name="UIStyleList" SelectionChanged="UIStyleList_SelectionChanged"> |
54 | 46 | <ListBox.ItemsPanel> |
55 | 47 | <ItemsPanelTemplate> |
56 | | - <VirtualizingStackPanel Orientation="Horizontal" /> |
| 48 | + <VirtualizingStackPanel Orientation="Horizontal"/> |
57 | 49 | </ItemsPanelTemplate> |
58 | 50 | </ListBox.ItemsPanel> |
59 | 51 | </ListBox> |
|
62 | 54 | </ContentControl> |
63 | 55 |
|
64 | 56 |
|
65 | | - <!-- Image preview and acquisition control --> |
66 | | - <ContentControl |
67 | | - Name="UIImageControls" |
68 | | - HorizontalAlignment="Stretch" |
69 | | - VerticalAlignment="Stretch" |
70 | | - IsEnabled="False"> |
| 57 | + <!--Image preview and acquisition control--> |
| 58 | + <ContentControl Name="UIImageControls" |
| 59 | + VerticalAlignment="Stretch" |
| 60 | + HorizontalAlignment="Stretch" |
| 61 | + IsEnabled="False"> |
71 | 62 |
|
72 | 63 | <StackPanel Orientation="Horizontal"> |
73 | | - <Button |
74 | | - Name="UIButtonLiveStream" |
75 | | - Click="UIButtonLiveStream_Click" |
76 | | - ToolTipService.ToolTip="Camera preview"> |
| 64 | + <Button Name="UIButtonLiveStream" |
| 65 | + ToolTipService.ToolTip="Camera preview" |
| 66 | + Click="UIButtonLiveStream_Click"> |
77 | 67 | <Button.Content> |
78 | | - <SymbolIcon Symbol="Video" /> |
| 68 | + <SymbolIcon Symbol="Video"/> |
79 | 69 | </Button.Content> |
80 | 70 | </Button> |
81 | | - <Button |
82 | | - Name="UIButtonAcquireImage" |
83 | | - Click="UIButtonAcquireImage_Click" |
84 | | - ToolTipService.ToolTip="Take a photo"> |
| 71 | + <Button Name="UIButtonAcquireImage" |
| 72 | + ToolTipService.ToolTip="Take a photo" |
| 73 | + Click="UIButtonAcquireImage_Click"> |
85 | 74 | <Button.Content> |
86 | | - <SymbolIcon Symbol="Camera" /> |
| 75 | + <SymbolIcon Symbol="Camera"/> |
87 | 76 | </Button.Content> |
88 | 77 | </Button> |
89 | | - <Button |
90 | | - Name="UIButtonFilePick" |
91 | | - Click="UIButtonFilePick_Click" |
92 | | - ToolTipService.ToolTip="Select an image from a file"> |
| 78 | + <Button Name="UIButtonFilePick" |
| 79 | + ToolTipService.ToolTip="Select an image from a file" |
| 80 | + Click="UIButtonFilePick_Click"> |
93 | 81 | <Button.Content> |
94 | | - <SymbolIcon Symbol="OpenFile" /> |
| 82 | + <SymbolIcon Symbol="OpenFile"/> |
95 | 83 | </Button.Content> |
96 | 84 | </Button> |
97 | | - <Button |
98 | | - Name="UIButtonInking" |
99 | | - Click="UIButtonInking_Click" |
100 | | - ToolTipService.ToolTip="Draw on a canvas"> |
| 85 | + <Button Name="UIButtonInking" |
| 86 | + ToolTipService.ToolTip="Draw on a canvas" |
| 87 | + Click="UIButtonInking_Click"> |
101 | 88 | <Button.Content> |
102 | | - <SymbolIcon Symbol="Edit" /> |
| 89 | + <SymbolIcon Symbol="Edit"/> |
103 | 90 | </Button.Content> |
104 | 91 | </Button> |
105 | | - <Button |
106 | | - Name="UIButtonSaveImage" |
107 | | - VerticalAlignment="Bottom" |
108 | | - Background="#FF939393" |
109 | | - Click="UIButtonSaveImage_Click" |
| 92 | + <Button Name="UIButtonSaveImage" |
| 93 | + ToolTipService.ToolTip="Save the image result to a file" |
110 | 94 | IsEnabled="false" |
111 | | - ToolTipService.ToolTip="Save the image result to a file"> |
| 95 | + VerticalAlignment="Bottom" |
| 96 | + Click="UIButtonSaveImage_Click" |
| 97 | + Background="#FF939393" > |
112 | 98 | <Button.Content> |
113 | | - <SymbolIcon Symbol="Save" /> |
| 99 | + <SymbolIcon Symbol="Save"/> |
114 | 100 | </Button.Content> |
115 | 101 | </Button> |
116 | 102 |
|
|
122 | 108 | <!--<Viewbox Stretch="Uniform" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Grid.Row="1">--> |
123 | 109 | <Grid Grid.Row="1"> |
124 | 110 | <Grid.ColumnDefinitions> |
125 | | - <ColumnDefinition Width="200*" /> |
126 | | - <ColumnDefinition Width="200*" /> |
| 111 | + <ColumnDefinition Width="200*"/> |
| 112 | + <ColumnDefinition Width="200*"/> |
127 | 113 | </Grid.ColumnDefinitions> |
128 | 114 |
|
129 | 115 | <Viewbox Stretch="Uniform"> |
130 | | - <StackPanel |
131 | | - Name="UIInkControls" |
132 | | - Grid.Column="0" |
133 | | - Visibility="Collapsed"> |
134 | | - <InkToolbar VerticalAlignment="Top" TargetInkCanvas="{x:Bind UIInkCanvasInput}" /> |
135 | | - |
136 | | - <!-- inking canvas --> |
137 | | - <Viewbox |
138 | | - MaxWidth="720" |
139 | | - MaxHeight="720" |
140 | | - Stretch="Uniform"> |
141 | | - <Grid BorderBrush="Black" BorderThickness="1"> |
142 | | - <Grid |
143 | | - Name="UIInkGrid" |
144 | | - MinWidth="200" |
145 | | - MinHeight="200" |
146 | | - MaxWidth="720" |
147 | | - MaxHeight="720" |
148 | | - Background="White"> |
149 | | - <InkCanvas Name="UIInkCanvasInput" /> |
| 116 | + <StackPanel Name="UIInkControls" |
| 117 | + Visibility="Collapsed" |
| 118 | + Grid.Column="0"> |
| 119 | + <InkToolbar TargetInkCanvas="{x:Bind UIInkCanvasInput}" VerticalAlignment="Top" /> |
| 120 | + |
| 121 | + <!--inking canvas--> |
| 122 | + <Viewbox Stretch="Uniform" |
| 123 | + MaxWidth="720" |
| 124 | + MaxHeight="720"> |
| 125 | + <Grid BorderBrush="Black" |
| 126 | + BorderThickness="1"> |
| 127 | + <Grid Name="UIInkGrid" |
| 128 | + Background="White" |
| 129 | + MinWidth="200" |
| 130 | + MinHeight="200" |
| 131 | + MaxWidth="720" |
| 132 | + MaxHeight="720"> |
| 133 | + <InkCanvas Name="UIInkCanvasInput"/> |
150 | 134 | </Grid> |
151 | 135 | </Grid> |
152 | 136 | </Viewbox> |
153 | 137 | </StackPanel> |
154 | 138 | </Viewbox> |
155 | 139 |
|
156 | | - <!-- Camera preview --> |
157 | | - <MediaPlayerElement |
158 | | - Name="UIMediaPlayerElement" |
159 | | - Grid.Column="0" |
160 | | - MaxWidth="720" |
161 | | - MaxHeight="720" |
162 | | - AreTransportControlsEnabled="False" |
163 | | - Canvas.ZIndex="-1" |
164 | | - Stretch="Uniform" /> |
165 | | - |
166 | | - <Image |
167 | | - Name="UIInputImage" |
168 | | - Grid.Column="0" |
169 | | - MaxWidth="720" |
170 | | - MaxHeight="720" |
171 | | - Stretch="Uniform" /> |
172 | | - |
173 | | - <Grid Grid.Column="1" VerticalAlignment="Stretch"> |
174 | | - |
175 | | - <Image |
176 | | - Name="UIResultImage" |
177 | | - MaxWidth="720" |
178 | | - MaxHeight="720" |
179 | | - Stretch="Uniform" /> |
180 | | - |
181 | | - <ProgressRing |
182 | | - Name="UIProcessingProgressRing" |
183 | | - MaxWidth="720" |
184 | | - MaxHeight="720" |
185 | | - IsActive="false" |
186 | | - Visibility="Collapsed" /> |
| 140 | + <!--Camera preview--> |
| 141 | + <MediaPlayerElement Name="UIMediaPlayerElement" |
| 142 | + Stretch="Uniform" |
| 143 | + AreTransportControlsEnabled="False" |
| 144 | + Canvas.ZIndex="-1" |
| 145 | + MaxWidth="720" |
| 146 | + MaxHeight="720" |
| 147 | + Grid.Column="0"/> |
| 148 | + |
| 149 | + <Image Name="UIInputImage" |
| 150 | + Grid.Column="0" |
| 151 | + Stretch="Uniform" |
| 152 | + MaxWidth="720" |
| 153 | + MaxHeight="720"/> |
| 154 | + |
| 155 | + <Grid Grid.Column="1" VerticalAlignment="Stretch"> |
| 156 | + |
| 157 | + <Image Name="UIResultImage" |
| 158 | + Stretch="Uniform" |
| 159 | + MaxWidth="720" |
| 160 | + MaxHeight="720"/> |
| 161 | + |
| 162 | + <ProgressRing Name="UIProcessingProgressRing" |
| 163 | + MaxWidth="720" |
| 164 | + MaxHeight="720" |
| 165 | + IsActive="false" |
| 166 | + Visibility="Collapsed"/> |
187 | 167 | </Grid> |
188 | 168 | </Grid> |
189 | 169 | <!--</Viewbox>--> |
190 | 170 |
|
191 | | - <StackPanel |
192 | | - Name="UICameraSelectionControls" |
193 | | - Grid.Row="1" |
194 | | - HorizontalAlignment="Left" |
195 | | - VerticalAlignment="Bottom" |
196 | | - Orientation="vertical" |
197 | | - Visibility="Collapsed"> |
198 | | - <TextBlock Style="{StaticResource TextBlockStyling}" Text="Camera: " /> |
199 | | - <ComboBox |
200 | | - Name="UICmbCamera" |
201 | | - Foreground="White" |
202 | | - SelectionChanged="UICmbCamera_SelectionChanged"> |
| 171 | + <StackPanel Name="UICameraSelectionControls" Orientation="vertical" Visibility="Collapsed" VerticalAlignment="Bottom" HorizontalAlignment="Left" Grid.Row="1"> |
| 172 | + <TextBlock Text="Camera: " Style="{StaticResource TextBlockStyling}"/> |
| 173 | + <ComboBox Name="UICmbCamera" SelectionChanged="UICmbCamera_SelectionChanged" Foreground="White" > |
203 | 174 | <ComboBox.Background> |
204 | | - <SolidColorBrush Opacity="0.3" Color="Black" /> |
| 175 | + <SolidColorBrush Color="Black" Opacity="0.3"/> |
205 | 176 | </ComboBox.Background> |
206 | 177 | </ComboBox> |
207 | | - <TextBlock Style="{StaticResource TextBlockStyling}" Text="Preview resolution: " /> |
208 | | - <TextBlock |
209 | | - Name="UITxtBlockPreviewProperties" |
210 | | - Style="{StaticResource TextBlockStyling}" |
211 | | - Text="0x0" /> |
| 178 | + <TextBlock Text="Preview resolution: " Style="{StaticResource TextBlockStyling}"/> |
| 179 | + <TextBlock Name="UITxtBlockPreviewProperties" Text="0x0" Style="{StaticResource TextBlockStyling}"/> |
212 | 180 | </StackPanel> |
213 | 181 |
|
214 | 182 | <Border x:Name="UIStatusBorder" Grid.Row="2"> |
215 | 183 | <StackPanel Orientation="Horizontal"> |
216 | | - <TextBlock |
217 | | - x:Name="StatusBlock" |
218 | | - Width="700" |
219 | | - Margin="10,2,0,0" |
220 | | - FontWeight="Bold" |
| 184 | + <TextBlock x:Name="StatusBlock" |
221 | 185 | Text="Select a style to begin" |
222 | | - TextWrapping="Wrap" /> |
223 | | - <TextBlock |
| 186 | + FontWeight="Bold" |
| 187 | + Width="700" |
224 | 188 | Margin="10,2,0,0" |
225 | | - FontWeight="Bold" |
226 | | - Text="Capture FPS" /> |
227 | | - <TextBlock |
228 | | - x:Name="CaptureFPS" |
| 189 | + TextWrapping="Wrap" /> |
| 190 | + <TextBlock |
| 191 | + Text="Capture FPS" |
229 | 192 | Margin="10,2,0,0" |
| 193 | + FontWeight="Bold" /> |
| 194 | + <TextBlock x:Name="CaptureFPS" |
230 | 195 | Text="0 fps" |
231 | | - TextWrapping="Wrap" /> |
232 | | - <TextBlock |
233 | 196 | Margin="10,2,0,0" |
234 | | - FontWeight="Bold" |
235 | | - Text="Render FPS" /> |
236 | | - <TextBlock |
237 | | - x:Name="RenderFPS" |
| 197 | + TextWrapping="Wrap" /> |
| 198 | + <TextBlock |
| 199 | + Text="Render FPS" |
238 | 200 | Margin="10,2,0,0" |
| 201 | + FontWeight="Bold"/> |
| 202 | + <TextBlock x:Name="RenderFPS" |
239 | 203 | Text="0 fps" |
| 204 | + Margin="10,2,0,0" |
240 | 205 | TextWrapping="Wrap" /> |
241 | 206 | </StackPanel> |
242 | 207 | </Border> |
|
0 commit comments