diff --git a/Sources/KinectSolution.sln b/Sources/KinectSolution.sln
new file mode 100644
index 0000000..d187b5e
--- /dev/null
+++ b/Sources/KinectSolution.sln
@@ -0,0 +1,31 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.8.34330.188
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WpfApp", "WpfApp\WpfApp.csproj", "{A5F0635D-16DD-4866-B48E-4E06ADFEEE92}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lib", "Lib\Lib.csproj", "{0751C83E-7845-4E5F-A5D3-E11ABA393ACA}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {A5F0635D-16DD-4866-B48E-4E06ADFEEE92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A5F0635D-16DD-4866-B48E-4E06ADFEEE92}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A5F0635D-16DD-4866-B48E-4E06ADFEEE92}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A5F0635D-16DD-4866-B48E-4E06ADFEEE92}.Release|Any CPU.Build.0 = Release|Any CPU
+ {0751C83E-7845-4E5F-A5D3-E11ABA393ACA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {0751C83E-7845-4E5F-A5D3-E11ABA393ACA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {0751C83E-7845-4E5F-A5D3-E11ABA393ACA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {0751C83E-7845-4E5F-A5D3-E11ABA393ACA}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {9EB7877A-8182-4040-939C-E0B134C4A74F}
+ EndGlobalSection
+EndGlobal
diff --git a/Sources/Lib/Class1.cs b/Sources/Lib/Class1.cs
new file mode 100644
index 0000000..dfbc46b
--- /dev/null
+++ b/Sources/Lib/Class1.cs
@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace Lib
+{
+ public class Class1
+ {
+ }
+}
diff --git a/Sources/Lib/Lib.csproj b/Sources/Lib/Lib.csproj
new file mode 100644
index 0000000..12682ba
--- /dev/null
+++ b/Sources/Lib/Lib.csproj
@@ -0,0 +1,54 @@
+
+
+
+
+ Debug
+ AnyCPU
+ 0751c83e-7845-4e5f-a5d3-e11aba393aca
+ Library
+ Properties
+ Lib
+ Lib
+ v4.7.2
+ 512
+ true
+
+
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Sources/Lib/Properties/AssemblyInfo.cs b/Sources/Lib/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..3631b9a
--- /dev/null
+++ b/Sources/Lib/Properties/AssemblyInfo.cs
@@ -0,0 +1,36 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// Les informations générales relatives à un assembly dépendent de
+// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations
+// associées à un assembly.
+[assembly: AssemblyTitle("Lib")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("Lib")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
+// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
+// COM, affectez la valeur true à l'attribut ComVisible sur ce type.
+[assembly: ComVisible(false)]
+
+// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM
+[assembly: Guid("0751c83e-7845-4e5f-a5d3-e11aba393aca")]
+
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+// Version principale
+// Version secondaire
+// Numéro de build
+// Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
+// en utilisant '*', comme indiqué ci-dessous :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Sources/WpfApp/App.config b/Sources/WpfApp/App.config
new file mode 100644
index 0000000..56efbc7
--- /dev/null
+++ b/Sources/WpfApp/App.config
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/WpfApp/App.xaml b/Sources/WpfApp/App.xaml
new file mode 100644
index 0000000..c41b4bf
--- /dev/null
+++ b/Sources/WpfApp/App.xaml
@@ -0,0 +1,9 @@
+
+
+
+
+
diff --git a/Sources/WpfApp/App.xaml.cs b/Sources/WpfApp/App.xaml.cs
new file mode 100644
index 0000000..ebc8edd
--- /dev/null
+++ b/Sources/WpfApp/App.xaml.cs
@@ -0,0 +1,17 @@
+using System;
+using System.Collections.Generic;
+using System.Configuration;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+using System.Windows;
+
+namespace WpfApp
+{
+ ///
+ /// Logique d'interaction pour App.xaml
+ ///
+ public partial class App : Application
+ {
+ }
+}
diff --git a/Sources/WpfApp/MainWindow.xaml b/Sources/WpfApp/MainWindow.xaml
new file mode 100644
index 0000000..5e4a5e2
--- /dev/null
+++ b/Sources/WpfApp/MainWindow.xaml
@@ -0,0 +1,33 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/WpfApp/MainWindow.xaml.cs b/Sources/WpfApp/MainWindow.xaml.cs
new file mode 100644
index 0000000..c3a4a84
--- /dev/null
+++ b/Sources/WpfApp/MainWindow.xaml.cs
@@ -0,0 +1,173 @@
+using Microsoft.Kinect;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace WpfApp
+{
+ ///
+ /// Logique d'interaction pour MainWindow.xaml
+ ///
+ public partial class MainWindow : Window
+ {
+ private KinectSensor kinectSensor = null;
+ private ColorFrameReader colorFrameReader = null;
+ private WriteableBitmap colorBitmap = null;
+
+ private BodyFrameReader bodyFrameReader = null;
+ private Body[] bodies = null;
+
+ // Propriété publique pour le binding
+ public WriteableBitmap ColorBitmap
+ {
+ get { return this.colorBitmap; }
+ }
+
+ public MainWindow()
+ {
+ InitializeComponent();
+
+ // Définir le DataContext pour le binding
+ this.DataContext = this;
+
+ // Initialiser la Kinect
+ this.kinectSensor = KinectSensor.GetDefault();
+
+ // Ouvrir le lecteur de flux de couleur
+ this.colorFrameReader = this.kinectSensor.ColorFrameSource.OpenReader();
+
+ // Frame description pour les images de couleur
+ FrameDescription colorFrameDescription = this.kinectSensor.ColorFrameSource.CreateFrameDescription(ColorImageFormat.Bgra);
+
+ // Créer le bitmap pour afficher l'image
+ this.colorBitmap = new WriteableBitmap(colorFrameDescription.Width, colorFrameDescription.Height, 96.0, 96.0, PixelFormats.Bgr32, null);
+
+ // Gérer l'événement FrameArrived pour le flux de couleur
+ this.colorFrameReader.FrameArrived += this.Reader_ColorFrameArrived;
+
+ // Initialisation du BodyFrameReader
+ this.bodyFrameReader = this.kinectSensor.BodyFrameSource.OpenReader();
+ this.bodyFrameReader.FrameArrived += this.Reader_BodyFrameArrived;
+
+ // Initialiser le tableau des corps
+ this.bodies = new Body[this.kinectSensor.BodyFrameSource.BodyCount];
+
+ // Ouvrir la Kinect
+ this.kinectSensor.Open();
+ }
+
+ private void Reader_ColorFrameArrived(object sender, ColorFrameArrivedEventArgs e)
+ {
+ using (ColorFrame colorFrame = e.FrameReference.AcquireFrame())
+ {
+ if (colorFrame != null)
+ {
+ FrameDescription colorFrameDescription = colorFrame.FrameDescription;
+
+ using (KinectBuffer colorBuffer = colorFrame.LockRawImageBuffer())
+ {
+ this.colorBitmap.Lock();
+
+ // Vérifier si la taille de l'image a changé
+ if ((colorFrameDescription.Width == this.colorBitmap.PixelWidth) && (colorFrameDescription.Height == this.colorBitmap.PixelHeight))
+ {
+ colorFrame.CopyConvertedFrameDataToIntPtr(
+ this.colorBitmap.BackBuffer,
+ (uint)(colorFrameDescription.Width * colorFrameDescription.Height * 4),
+ ColorImageFormat.Bgra);
+
+ this.colorBitmap.AddDirtyRect(new Int32Rect(0, 0, this.colorBitmap.PixelWidth, this.colorBitmap.PixelHeight));
+ }
+
+ this.colorBitmap.Unlock();
+ }
+ }
+ }
+ }
+
+ // Assurez-vous de fermer correctement le lecteur et le capteur Kinect lors de la fermeture de la fenêtre
+ private void MainWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
+ {
+ if (this.colorFrameReader != null)
+ {
+ this.colorFrameReader.Dispose();
+ this.colorFrameReader = null;
+ }
+
+ if (this.kinectSensor != null)
+ {
+ this.kinectSensor.Close();
+ this.kinectSensor = null;
+ }
+ }
+
+ private void Reader_BodyFrameArrived(object sender, BodyFrameArrivedEventArgs e)
+ {
+ using (var bodyFrame = e.FrameReference.AcquireFrame())
+ {
+ if (bodyFrame != null)
+ {
+ bodyFrame.GetAndRefreshBodyData(this.bodies);
+
+ skeletonCanvas.Children.Clear(); // Nettoyer le canvas avant de dessiner
+
+ foreach (var body in this.bodies)
+ {
+ if (body.IsTracked)
+ {
+ // Dessiner le squelette
+ DrawSkeleton(body);
+ }
+ }
+ }
+ }
+ }
+
+ private void DrawSkeleton(Body body)
+ {
+ foreach (JointType jointType in body.Joints.Keys)
+ {
+ Joint joint = body.Joints[jointType];
+ if (joint.TrackingState == TrackingState.Tracked)
+ {
+ // Convertir les coordonnées du joint en coordonnées de l'écran
+ Point point = new Point();
+ ColorSpacePoint colorPoint = this.kinectSensor.CoordinateMapper.MapCameraPointToColorSpace(joint.Position);
+ point.X = float.IsInfinity(colorPoint.X) ? 0 : colorPoint.X;
+ point.Y = float.IsInfinity(colorPoint.Y) ? 0 : colorPoint.Y;
+
+ // Dessiner le joint
+ DrawJoint(point);
+ }
+ }
+
+ // Dessinez les os ici si nécessaire
+ }
+
+ private void DrawJoint(Point point)
+ {
+ Ellipse ellipse = new Ellipse
+ {
+ Width = 10,
+ Height = 10,
+ Fill = new SolidColorBrush(Colors.Red)
+ };
+
+ Canvas.SetLeft(ellipse, point.X - ellipse.Width / 2);
+ Canvas.SetTop(ellipse, point.Y - ellipse.Height / 2);
+
+ skeletonCanvas.Children.Add(ellipse);
+ }
+ }
+}
diff --git a/Sources/WpfApp/Properties/AssemblyInfo.cs b/Sources/WpfApp/Properties/AssemblyInfo.cs
new file mode 100644
index 0000000..a44044c
--- /dev/null
+++ b/Sources/WpfApp/Properties/AssemblyInfo.cs
@@ -0,0 +1,55 @@
+using System.Reflection;
+using System.Resources;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using System.Windows;
+
+// Les informations générales relatives à un assembly dépendent de
+// l'ensemble d'attributs suivant. Pour modifier les informations
+// associées à un assembly.
+[assembly: AssemblyTitle("WpfApp")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("WpfApp")]
+[assembly: AssemblyCopyright("Copyright © 2024")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly
+// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de
+// COM, affectez la valeur True à l'attribut ComVisible sur ce type.
+[assembly: ComVisible(false)]
+
+//Pour commencer à générer des applications localisables, définissez
+//CultureUtiliséePourCoder dans votre fichier .csproj
+//dans . Par exemple, si vous utilisez le français
+//dans vos fichiers sources, définissez à fr-FR. Puis, supprimez les marques de commentaire de
+//l'attribut NeutralResourceLanguage ci-dessous. Mettez à jour "fr-FR" dans
+//la ligne ci-après pour qu'elle corresponde au paramètre UICulture du fichier projet.
+
+//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
+
+
+[assembly: ThemeInfo(
+ ResourceDictionaryLocation.None, //où se trouvent les dictionnaires de ressources spécifiques à un thème
+ //(utilisé si une ressource est introuvable dans la page,
+ // ou dictionnaires de ressources de l'application)
+ ResourceDictionaryLocation.SourceAssembly //où se trouve le dictionnaire de ressources générique
+ //(utilisé si une ressource est introuvable dans la page,
+ // dans l'application ou dans l'un des dictionnaires de ressources spécifiques à un thème)
+)]
+
+
+// Les informations de version pour un assembly se composent des quatre valeurs suivantes :
+//
+// Version principale
+// Version secondaire
+// Numéro de build
+// Révision
+//
+// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut
+// en utilisant '*', comme indiqué ci-dessous :
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/Sources/WpfApp/Properties/Resources.Designer.cs b/Sources/WpfApp/Properties/Resources.Designer.cs
new file mode 100644
index 0000000..aea860e
--- /dev/null
+++ b/Sources/WpfApp/Properties/Resources.Designer.cs
@@ -0,0 +1,71 @@
+//------------------------------------------------------------------------------
+//
+// Ce code a été généré par un outil.
+// Version du runtime :4.0.30319.42000
+//
+// Les modifications apportées à ce fichier peuvent provoquer un comportement incorrect et seront perdues si
+// le code est régénéré.
+//
+//------------------------------------------------------------------------------
+
+namespace WpfApp.Properties
+{
+
+
+ ///
+ /// Une classe de ressource fortement typée destinée, entre autres, à la consultation des chaînes localisées.
+ ///
+ // Cette classe a été générée automatiquement par la classe StronglyTypedResourceBuilder
+ // à l'aide d'un outil, tel que ResGen ou Visual Studio.
+ // Pour ajouter ou supprimer un membre, modifiez votre fichier .ResX, puis réexécutez ResGen
+ // avec l'option /str ou régénérez votre projet VS.
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
+ [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ internal class Resources
+ {
+
+ private static global::System.Resources.ResourceManager resourceMan;
+
+ private static global::System.Globalization.CultureInfo resourceCulture;
+
+ [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
+ internal Resources()
+ {
+ }
+
+ ///
+ /// Retourne l'instance ResourceManager mise en cache utilisée par cette classe.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Resources.ResourceManager ResourceManager
+ {
+ get
+ {
+ if ((resourceMan == null))
+ {
+ global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("WpfApp.Properties.Resources", typeof(Resources).Assembly);
+ resourceMan = temp;
+ }
+ return resourceMan;
+ }
+ }
+
+ ///
+ /// Remplace la propriété CurrentUICulture du thread actuel pour toutes
+ /// les recherches de ressources à l'aide de cette classe de ressource fortement typée.
+ ///
+ [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
+ internal static global::System.Globalization.CultureInfo Culture
+ {
+ get
+ {
+ return resourceCulture;
+ }
+ set
+ {
+ resourceCulture = value;
+ }
+ }
+ }
+}
diff --git a/Sources/WpfApp/Properties/Resources.resx b/Sources/WpfApp/Properties/Resources.resx
new file mode 100644
index 0000000..af7dbeb
--- /dev/null
+++ b/Sources/WpfApp/Properties/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Sources/WpfApp/Properties/Settings.Designer.cs b/Sources/WpfApp/Properties/Settings.Designer.cs
new file mode 100644
index 0000000..a9aae82
--- /dev/null
+++ b/Sources/WpfApp/Properties/Settings.Designer.cs
@@ -0,0 +1,30 @@
+//------------------------------------------------------------------------------
+//
+// This code was generated by a tool.
+// Runtime Version:4.0.30319.42000
+//
+// Changes to this file may cause incorrect behavior and will be lost if
+// the code is regenerated.
+//
+//------------------------------------------------------------------------------
+
+namespace WpfApp.Properties
+{
+
+
+ [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
+ [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
+ internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
+ {
+
+ private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
+
+ public static Settings Default
+ {
+ get
+ {
+ return defaultInstance;
+ }
+ }
+ }
+}
diff --git a/Sources/WpfApp/Properties/Settings.settings b/Sources/WpfApp/Properties/Settings.settings
new file mode 100644
index 0000000..033d7a5
--- /dev/null
+++ b/Sources/WpfApp/Properties/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/WpfApp/WpfApp.csproj b/Sources/WpfApp/WpfApp.csproj
new file mode 100644
index 0000000..950c7f9
--- /dev/null
+++ b/Sources/WpfApp/WpfApp.csproj
@@ -0,0 +1,102 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {A5F0635D-16DD-4866-B48E-4E06ADFEEE92}
+ WinExe
+ WpfApp
+ WpfApp
+ v4.7.2
+ 512
+ {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ 4
+ true
+ true
+
+
+ AnyCPU
+ true
+ full
+ false
+ bin\Debug\
+ DEBUG;TRACE
+ prompt
+ 4
+
+
+ AnyCPU
+ pdbonly
+ true
+ bin\Release\
+ TRACE
+ prompt
+ 4
+
+
+
+ ..\packages\Microsoft.Kinect.2.0.1410.19000\lib\net45\Microsoft.Kinect.dll
+
+
+
+
+
+
+
+
+
+
+ 4.0
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+ MSBuild:Compile
+ Designer
+
+
+ App.xaml
+ Code
+
+
+ MainWindow.xaml
+ Code
+
+
+
+
+ Code
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+ ResXFileCodeGenerator
+ Resources.Designer.cs
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Sources/WpfApp/packages.config b/Sources/WpfApp/packages.config
new file mode 100644
index 0000000..f7f19c3
--- /dev/null
+++ b/Sources/WpfApp/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file