You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

51 lines
2.9 KiB

<Window x:Class="WpfApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:WpfApp"
mc:Ignorable="d"
Title="Interface Kinect" Height="450" Width="800">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<StackPanel Grid.Row="0" Orientation="Horizontal" VerticalAlignment="Top">
<Ellipse Width="20" Height="20" Fill="{Binding CurrentKinectStream.KinectManager.KinectStatusColor}" />
<TextBlock Text="{Binding CurrentKinectStream.KinectManager.StatusText}" VerticalAlignment="Center" Margin="5,0,0,0"/>
</StackPanel>
<StackPanel Grid.Row="1" Orientation="Horizontal" VerticalAlignment="Top">
<Button Content="Color" Margin="5" Click="ToColorImageStream"/>
<Button Content="Depth" Margin="5" Click="ToDepthImageStream"/>
<Button Content="Infrared" Margin="5" Click="ToInfraredImageStream"/>
<Button Content="Body" Margin="5" Click="ToBodyImageStream"/>
<Button Content="BodyAndColor" Margin="5" Click="ToColorAndBodyImageStream"/>
<Button Content="StartGame" Margin="5" Click="StartGameButton_Click"/>
<Button Content="StopGame" Margin="5" Click="StartGameButton_Click"/>
</StackPanel>
<Viewbox Grid.Row="2" Stretch="Uniform">
<Grid>
<!-- L'arrière-plan du capteur de couleur -->
<Image Source="{Binding CurrentKinectStream.Bitmap}" />
<!-- Le Canvas pour le squelette doit être par-dessus l'image -->
<Canvas x:Name="skeletonCanvas" />
<!-- Le Canvas pour les cercles doit être le dernier pour qu'il soit au premier plan -->
<Canvas x:Name="gameCanvas" Loaded="GameCanvas_Loaded">
<Ellipse x:Name="clapCircle" Width="100" Height="100" Fill="Purple" Opacity="0.5"/>
</Canvas>
</Grid>
</Viewbox>
<StackPanel Grid.Row="2" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Bottom" Margin="10">
<TextBlock Text="Score: " FontWeight="Bold" FontSize="16"/>
<TextBlock x:Name="scoreText" Text="{Binding Score}" FontWeight="Bold" FontSize="16" Margin="5,0"/>
<TextBlock Text="Feedback: " FontWeight="Bold" FontSize="16" Margin="20,0,0,0"/>
<TextBlock x:Name="feedbackText" Text="{Binding Feedback}" FontWeight="Bold" FontSize="16" Foreground="Green" Margin="5,0"/>
</StackPanel>
</Grid>
</Window>