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