commit b5823a10590e4d4c90b7823e16f65bbdf2b4dc9a Author: BlubbFish Date: Sun Nov 15 17:33:38 2015 +0000 Kinkect hinzugefügt diff --git a/Demo1/Demo1.sln b/Demo1/Demo1.sln new file mode 100644 index 0000000..f884125 --- /dev/null +++ b/Demo1/Demo1.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo1", "Demo1\Demo1.csproj", "{1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E}.Debug|x86.ActiveCfg = Debug|x86 + {1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E}.Debug|x86.Build.0 = Debug|x86 + {1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E}.Release|x86.ActiveCfg = Release|x86 + {1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo1/Demo1/App.xaml b/Demo1/Demo1/App.xaml new file mode 100644 index 0000000..e0af758 --- /dev/null +++ b/Demo1/Demo1/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Demo1/Demo1/App.xaml.cs b/Demo1/Demo1/App.xaml.cs new file mode 100644 index 0000000..473f9d7 --- /dev/null +++ b/Demo1/Demo1/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace Demo1 +{ + /// + /// Interaktionslogik für "App.xaml" + /// + public partial class App : Application + { + } +} diff --git a/Demo1/Demo1/Demo1.csproj b/Demo1/Demo1/Demo1.csproj new file mode 100644 index 0000000..6d7bde2 --- /dev/null +++ b/Demo1/Demo1/Demo1.csproj @@ -0,0 +1,106 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {1D0066B4-E5EE-4F76-97E4-0372F1EFAE1E} + WinExe + Properties + Demo1 + Demo1 + v4.0 + Client + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 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/Demo1/Demo1/DepthFrameConverter.cs b/Demo1/Demo1/DepthFrameConverter.cs new file mode 100644 index 0000000..2bea220 --- /dev/null +++ b/Demo1/Demo1/DepthFrameConverter.cs @@ -0,0 +1,116 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace KinectWorkshop +{ + public class DepthFrameConverter + { + const int RED_IDX = 2; + const int GREEN_IDX = 1; + const int BLUE_IDX = 0; + byte[] depthFrame32 = new byte[320 * 240 * 4]; + + // Converts a 16-bit grayscale depth frame which includes player indexes into a 32-bit frame + // that displays different players in different colors + public byte[] ConvertDepthFrameWithUser(byte[] depthFrame16) + { + for (int i16 = 0, i32 = 0; i16 < depthFrame16.Length && i32 < depthFrame32.Length; i16 += 2, i32 += 4) + { + int player = depthFrame16[i16] & 0x07; + //if ((y - 1) * 320 + x * 4 == i16) + //{ + // player = 8; + //} + int realDepth = (depthFrame16[i16 + 1] << 5) | (depthFrame16[i16] >> 3); + // transform 13-bit depth information into an 8-bit intensity appropriate + // for display (we disregard information in most significant bit) + byte intensity = (byte)(255 - (255 * realDepth / 0x0fff)); + + depthFrame32[i32 + RED_IDX] = 0; + depthFrame32[i32 + GREEN_IDX] = 0; + depthFrame32[i32 + BLUE_IDX] = 0; + + // choose different display colors based on player + switch (player) + { + case 0: + depthFrame32[i32 + RED_IDX] = (byte)(intensity / 2); + depthFrame32[i32 + GREEN_IDX] = (byte)(intensity / 2); + depthFrame32[i32 + BLUE_IDX] = (byte)(intensity / 2); + break; + case 1: + depthFrame32[i32 + RED_IDX] = intensity; + break; + case 2: + depthFrame32[i32 + GREEN_IDX] = intensity; + break; + case 3: + depthFrame32[i32 + RED_IDX] = (byte)(intensity / 4); + depthFrame32[i32 + GREEN_IDX] = (byte)(intensity); + depthFrame32[i32 + BLUE_IDX] = (byte)(intensity); + break; + case 4: + depthFrame32[i32 + RED_IDX] = (byte)(intensity); + depthFrame32[i32 + GREEN_IDX] = (byte)(intensity); + depthFrame32[i32 + BLUE_IDX] = (byte)(intensity / 4); + break; + case 5: + depthFrame32[i32 + RED_IDX] = (byte)(intensity); + depthFrame32[i32 + GREEN_IDX] = (byte)(intensity / 4); + depthFrame32[i32 + BLUE_IDX] = (byte)(intensity); + break; + case 6: + depthFrame32[i32 + RED_IDX] = (byte)(intensity / 2); + depthFrame32[i32 + GREEN_IDX] = (byte)(intensity / 2); + depthFrame32[i32 + BLUE_IDX] = (byte)(intensity); + break; + case 7: + depthFrame32[i32 + RED_IDX] = (byte)(255 - intensity); + depthFrame32[i32 + GREEN_IDX] = (byte)(255 - intensity); + depthFrame32[i32 + BLUE_IDX] = (byte)(255 - intensity); + break; + case 8: + depthFrame32[i32 + RED_IDX] = 255; + depthFrame32[i32 + GREEN_IDX] = 0; + depthFrame32[i32 + BLUE_IDX] = 0; + break; + } + } + return depthFrame32; + } + + internal byte[] ConvertDepthFrame(byte[] depthFrame16) + { + for (int i16 = 0, i32 = 0; i16 < depthFrame16.Length && i32 < depthFrame32.Length; i16 += 2, i32 += 4) + { + int realDepth = (depthFrame16[i16+1] << 8)|(depthFrame16[i16]); + //byte r = (byte)(realDepth >> 8); + //byte b = (byte)realDepth; + byte intensity = (byte)(255 - (255 * realDepth / 0x0fff)); + depthFrame32[i32 + RED_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + depthFrame32[i32 + GREEN_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + depthFrame32[i32 + BLUE_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + + } + return depthFrame32; + } + + internal byte[] ConvertDepthFrameHiddenPlayer(byte[] depthFrame16) + { + for (int i16 = 0, i32 = 0; i16 < depthFrame16.Length && i32 < depthFrame32.Length; i16 += 2, i32 += 4) + { + int realDepth = (depthFrame16[i16 + 1] << 5) | (depthFrame16[i16] >> 3); + //byte r = (byte)(realDepth >> 8); + //byte b = (byte)realDepth; + byte intensity = (byte)(255 - (255 * realDepth / 0x0fff)); + depthFrame32[i32 + RED_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + depthFrame32[i32 + GREEN_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + depthFrame32[i32 + BLUE_IDX] = (byte)((intensity * -1) + 255);// (byte)(intensity / 2); + + } + return depthFrame32; + } + } +} diff --git a/Demo1/Demo1/MainWindow.xaml b/Demo1/Demo1/MainWindow.xaml new file mode 100644 index 0000000..71a6b8e --- /dev/null +++ b/Demo1/Demo1/MainWindow.xaml @@ -0,0 +1,15 @@ + + + + + + + + + diff --git a/Demo1/Demo1/MainWindow.xaml.cs b/Demo1/Demo1/MainWindow.xaml.cs new file mode 100644 index 0000000..7bf2cc7 --- /dev/null +++ b/Demo1/Demo1/MainWindow.xaml.cs @@ -0,0 +1,162 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +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; +using Microsoft.Research.Kinect.Nui; + +namespace Demo1 +{ + /// + /// Interaktionslogik für MainWindow.xaml + /// + public partial class MainWindow : Window + { + private KinectWorkshop.DepthFrameConverter cv = new KinectWorkshop.DepthFrameConverter(); + private Camera _cam; + public MainWindow() + { + InitializeComponent(); + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + if (Runtime.Kinects.Count == 0) + { + MessageBox.Show("Keine Kinect"); + return; + } + try + { + Runtime r = Runtime.Kinects[0]; + r.Initialize(RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseDepthAndPlayerIndex); + + //r.VideoFrameReady += new EventHandler(r_VideoFrameReady); + //r.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color); + + r.DepthFrameReady += new EventHandler(r_DepthFrameReady); + r.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex); + r.SkeletonEngine.TransformSmooth = true; + r.SkeletonFrameReady += new EventHandler(r_SkeletonFrameReady); + _cam = r.NuiCamera; + } + catch (Exception ex) + { + MessageBox.Show(ex.ToString()); + } + } + + void r_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) + { + this.MainCanvas.Children.Clear(); + foreach (SkeletonData sk in e.SkeletonFrame.Skeletons) + { + if (sk.TrackingState == SkeletonTrackingState.Tracked) + { + this.SetLines(sk); + this.SetPoints(sk); + } + } + } + + private void SetLines(SkeletonData sk) + { + JointID[,] id = { + { JointID.Head, JointID.ShoulderCenter }, + { JointID.ShoulderCenter, JointID.ShoulderLeft }, + { JointID.ShoulderCenter, JointID.ShoulderRight }, + { JointID.ShoulderLeft, JointID.ElbowLeft }, + { JointID.ShoulderRight, JointID.ElbowRight }, + { JointID.ElbowLeft, JointID.WristLeft }, + { JointID.ElbowRight, JointID.WristRight }, + { JointID.WristLeft, JointID.HandLeft }, + { JointID.WristRight, JointID.HandRight }, + { JointID.ShoulderCenter, JointID.Spine }, + { JointID.Spine, JointID.HipCenter }, + { JointID.HipCenter, JointID.HipLeft }, + { JointID.HipCenter, JointID.HipRight }, + { JointID.HipLeft, JointID.KneeLeft }, + { JointID.HipRight, JointID.KneeRight }, + { JointID.KneeLeft, JointID.AnkleLeft }, + { JointID.KneeRight, JointID.AnkleRight }, + { JointID.AnkleLeft, JointID.FootLeft }, + { JointID.AnkleRight, JointID.FootRight } + }; + for (int i = 0; i < id.Length / 2; i++) + { + Joint r1 = sk.Joints[id[i, 0]].ScaleTo(640, 480); + Joint r2 = sk.Joints[id[i, 1]].ScaleTo(640, 480); + Line l = new Line(); + l.Stroke = Brushes.Blue; + l.StrokeThickness = 5.0; + l.Y1 = r1.Position.Y; + l.X1 = r1.Position.X; + l.Y2 = r2.Position.Y; + l.X2 = r2.Position.X; + this.MainCanvas.Children.Add(l); + } + } + + private void SetPoints(SkeletonData sk) + { + foreach (Joint joint in sk.Joints) + { + Joint p = joint.ScaleTo(640, 480); + Ellipse e = new Ellipse(); + e.Fill = Brushes.Red; + e.Stroke = Brushes.Black; + e.Height = 10; + e.Width = 10; + Canvas.SetLeft(e, p.Position.X - e.Width / 2); + Canvas.SetTop(e, p.Position.Y - e.Height / 2); + this.MainCanvas.Children.Add(e); + } + } + + void r_DepthFrameReady(object sender, ImageFrameReadyEventArgs e) + { + PlanarImage img = e.ImageFrame.Image; + byte[] bh = cv.ConvertDepthFrameWithUser(img.Bits); + imgDepth.Source = BitmapSource.Create(img.Width, img.Height, + 96, 96, PixelFormats.Bgr32, null, + bh, img.Width * 4); + //bh = cv.ConvertDepthFrameHiddenPlayer(img.Bits); + //byte[] bh = cv.ConvertDepthFrame(img.Bits); + //imgDepthPlayer.Source = BitmapSource.Create(img.Width, img.Height, + // 96, 96, PixelFormats.Bgr32, null, + // bh, img.Width * 4); + } + + private void Window_KeyUp(object sender, KeyEventArgs e) + { + try + { + if (e.Key == Key.OemPlus) + _cam.ElevationAngle += 1; + if (e.Key == Key.OemMinus) + _cam.ElevationAngle -= 1; + } + catch (ArgumentOutOfRangeException outOfRangeException) + { + MessageBox.Show(outOfRangeException.Message); + } + catch (Exception) { } + } + + /*void r_VideoFrameReady(object sender, ImageFrameReadyEventArgs e) + { + PlanarImage img = e.ImageFrame.Image; + imgRgb.Source = BitmapSource.Create(img.Width, img.Height, + 96, 96, PixelFormats.Bgr32, null, + img.Bits, img.Width * img.BytesPerPixel); + }*/ + } +} diff --git a/Demo1/Demo1/Properties/AssemblyInfo.cs b/Demo1/Demo1/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..63cf8a1 --- /dev/null +++ b/Demo1/Demo1/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo1")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo1")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie +//ImCodeVerwendeteKultur in der .csproj-Datei +//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch +//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung +//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, +//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher + //(wird verwendet, wenn eine Ressource auf der Seite + // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) + ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs + //(wird verwendet, wenn eine Ressource auf der Seite, in der Anwendung oder einem + // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) +)] + + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo1/Demo1/Properties/Resources.Designer.cs b/Demo1/Demo1/Properties/Resources.Designer.cs new file mode 100644 index 0000000..663e2fe --- /dev/null +++ b/Demo1/Demo1/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.239 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Demo1.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [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() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("Demo1.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [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/Demo1/Demo1/Properties/Resources.resx b/Demo1/Demo1/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/Demo1/Demo1/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/Demo1/Demo1/Properties/Settings.Designer.cs b/Demo1/Demo1/Properties/Settings.Designer.cs new file mode 100644 index 0000000..eb19839 --- /dev/null +++ b/Demo1/Demo1/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Demo1.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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/Demo1/Demo1/Properties/Settings.settings b/Demo1/Demo1/Properties/Settings.settings new file mode 100644 index 0000000..8f2fd95 --- /dev/null +++ b/Demo1/Demo1/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/Demo1/Demo1/SkeletalCommonExtensions.cs b/Demo1/Demo1/SkeletalCommonExtensions.cs new file mode 100644 index 0000000..2f5b2b3 --- /dev/null +++ b/Demo1/Demo1/SkeletalCommonExtensions.cs @@ -0,0 +1,42 @@ +using Microsoft.Research.Kinect.Nui; + +namespace Demo1 +{ + internal static class SkeletalCommonExtensions + { + public static Joint ScaleTo(this Joint joint, int width, int height, float skeletonMaxX, float skeletonMaxY) + { + Vector pos = new Vector() + { + X = Scale(width, skeletonMaxX, joint.Position.X), + Y = Scale(height, skeletonMaxY, -joint.Position.Y), + Z = joint.Position.Z, + W = joint.Position.W + }; + + Joint j = new Joint() + { + ID = joint.ID, + TrackingState = joint.TrackingState, + Position = pos + }; + + return j; + } + + public static Joint ScaleTo(this Joint joint, int width, int height) + { + return ScaleTo(joint, width, height, 1.0f, 1.0f); + } + + private static float Scale(int maxPixel, float maxSkeleton, float position) + { + float value = ((((maxPixel / maxSkeleton) / 2) * position) + (maxPixel / 2)); + if (value > maxPixel) + return maxPixel; + if (value < 0) + return 0; + return value; + } + } +} diff --git a/Demo2/Demo2.sln b/Demo2/Demo2.sln new file mode 100644 index 0000000..d031159 --- /dev/null +++ b/Demo2/Demo2.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo2", "Demo2\Demo2.csproj", "{12018BA3-A02D-488C-83F6-1799D344C1C3}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {12018BA3-A02D-488C-83F6-1799D344C1C3}.Debug|x86.ActiveCfg = Debug|x86 + {12018BA3-A02D-488C-83F6-1799D344C1C3}.Debug|x86.Build.0 = Debug|x86 + {12018BA3-A02D-488C-83F6-1799D344C1C3}.Release|x86.ActiveCfg = Release|x86 + {12018BA3-A02D-488C-83F6-1799D344C1C3}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo2/Demo2/Demo2.csproj b/Demo2/Demo2/Demo2.csproj new file mode 100644 index 0000000..09a7d25 --- /dev/null +++ b/Demo2/Demo2/Demo2.csproj @@ -0,0 +1,58 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {12018BA3-A02D-488C-83F6-1799D344C1C3} + Exe + Properties + Demo2 + Demo2 + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo2/Demo2/Program.cs b/Demo2/Demo2/Program.cs new file mode 100644 index 0000000..9b416ce --- /dev/null +++ b/Demo2/Demo2/Program.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Research.Kinect.Nui; + +namespace Demo2 +{ + class Program + { + static void Main(string[] args) + { + if (Runtime.Kinects.Count == 0) + { + Console.WriteLine("KEine Kinect"); + return; + } + Runtime r = Runtime.Kinects[0]; + r.Initialize(RuntimeOptions.UseSkeletalTracking); + r.SkeletonFrameReady += new EventHandler(r_SkeletonFrameReady); + r.SkeletonEngine.TransformSmooth = true; + + Console.ReadLine(); + r.Uninitialize(); + } + + static void r_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) + { + foreach (SkeletonData sk in e.SkeletonFrame.Skeletons) + { + if (sk.TrackingState == SkeletonTrackingState.Tracked) + { + Joint l = sk.Joints[JointID.HandLeft]; + Joint r = sk.Joints[JointID.HandRight]; + Console.WriteLine("Left Hand: X:{0}, Y:{1}, Z:{2}", l.Position.X, l.Position.Y, l.Position.Z); + Console.WriteLine("Right Hand: X:{0}, Y:{1}, Z:{2}", r.Position.X, r.Position.Y, r.Position.Z); + } + } + Console.WriteLine(); + } + } +} diff --git a/Demo2/Demo2/Properties/AssemblyInfo.cs b/Demo2/Demo2/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..b4f6832 --- /dev/null +++ b/Demo2/Demo2/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo2")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo2")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("c0c8b6f9-5275-4f3b-a622-0a78d2a3a3dd")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo3/Demo3.sln b/Demo3/Demo3.sln new file mode 100644 index 0000000..470c101 --- /dev/null +++ b/Demo3/Demo3.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo3", "Demo3\Demo3.csproj", "{33D30437-2141-4BEE-B4DE-FBF5B01F7A8C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {33D30437-2141-4BEE-B4DE-FBF5B01F7A8C}.Debug|x86.ActiveCfg = Debug|x86 + {33D30437-2141-4BEE-B4DE-FBF5B01F7A8C}.Debug|x86.Build.0 = Debug|x86 + {33D30437-2141-4BEE-B4DE-FBF5B01F7A8C}.Release|x86.ActiveCfg = Release|x86 + {33D30437-2141-4BEE-B4DE-FBF5B01F7A8C}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo3/Demo3/Demo3.csproj b/Demo3/Demo3/Demo3.csproj new file mode 100644 index 0000000..cbde53e --- /dev/null +++ b/Demo3/Demo3/Demo3.csproj @@ -0,0 +1,63 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {33D30437-2141-4BEE-B4DE-FBF5B01F7A8C} + Exe + Properties + Demo3 + Demo3 + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + False + C:\Program Files\Microsoft Speech Platform SDK\Assembly\Microsoft.Speech.dll + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo3/Demo3/Program.cs b/Demo3/Demo3/Program.cs new file mode 100644 index 0000000..9fff74f --- /dev/null +++ b/Demo3/Demo3/Program.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Demo3 +{ + class Program + { + static void Main(string[] args) + { + KinectWorkshop.SpeechToText stt = new KinectWorkshop.SpeechToText(); + stt.TextRecognized += new EventHandler(stt_TextRecognized); + stt.Start(); + Console.ReadLine(); + stt.Stop(); + } + + static void stt_TextRecognized(object sender, KinectWorkshop.SpeechToText.TextRecognizedArgs e) + { + Console.WriteLine(e.Verb); + switch (e.Verb) + { + case KinectWorkshop.SpeechToText.Verbs.None: + break; + case KinectWorkshop.SpeechToText.Verbs.PreviousSlide: + break; + case KinectWorkshop.SpeechToText.Verbs.NextSlide: + break; + default: + break; + } + } + } +} diff --git a/Demo3/Demo3/Properties/AssemblyInfo.cs b/Demo3/Demo3/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..1bb236a --- /dev/null +++ b/Demo3/Demo3/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo3")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo3")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("1fd608c9-3dd2-4d4b-b7a0-c368ff56a377")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo3/Demo3/SpeechToText.cs b/Demo3/Demo3/SpeechToText.cs new file mode 100644 index 0000000..4d2cb32 --- /dev/null +++ b/Demo3/Demo3/SpeechToText.cs @@ -0,0 +1,136 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Threading; +using Microsoft.Research.Kinect.Audio; +using Microsoft.Speech.AudioFormat; +using Microsoft.Speech.Recognition; + +namespace KinectWorkshop +{ + public class SpeechToText + { + public enum Verbs + { + None = 0, + PreviousSlide, + NextSlide + }; + + Dictionary SinglePhrases = new Dictionary() + { + {"previous slide", Verbs.PreviousSlide}, + {"next slide", Verbs.NextSlide} + }; + + public class TextRecognizedArgs : EventArgs + { + public Verbs Verb { get; set; } + public string Phrase { get; set; } + public string Matched {get; set; } + } + + public event EventHandler TextRecognized; + + private KinectAudioSource kinectSource; + private SpeechRecognitionEngine sre; + private const string RecognizerId = "SR_MS_en-US_Kinect_10.0"; + + public SpeechToText() + { + RecognizerInfo ri = SpeechRecognitionEngine.InstalledRecognizers().Where(r => r.Id == RecognizerId).FirstOrDefault(); + if (ri == null) + return; + + sre = new SpeechRecognitionEngine(ri.Id); + var singlePhrases = new Choices(); + foreach (var phrase in SinglePhrases) + singlePhrases.Add(phrase.Key); + + var g = new Grammar(new GrammarBuilder(singlePhrases)); + sre.LoadGrammar(g); + sre.SpeechRecognized += sre_SpeechRecognized; + sre.SpeechRecognitionRejected += new EventHandler(sre_SpeechRecognitionRejected); + } + + private void StartSST() + { + kinectSource = new KinectAudioSource(); + kinectSource.SystemMode = SystemMode.OptibeamArrayOnly; + kinectSource.FeatureMode = true; + kinectSource.AutomaticGainControl = false; + kinectSource.MicArrayMode = MicArrayMode.MicArrayAdaptiveBeam; + var kinectStream = kinectSource.Start(); + sre.SetInputToAudioStream(kinectStream, new SpeechAudioFormatInfo( + EncodingFormat.Pcm, 16000, 16, 1, + 32000, 2, null)); + sre.RecognizeAsync(RecognizeMode.Multiple); + + //const double alpha = 0.35; + //double angle = 0.0; + //while (true) + //{ + // if (kinectSource.SoundSourcePositionConfidence > 0.5) + // { + // double a = alpha*kinectSource.SoundSourcePositionConfidence; + // angle = (1 - a) * angle + a * kinectSource.SoundSourcePosition; + // Console.WriteLine(angle + ":" + kinectSource.MicArrayBeamAngle); + // } + // System.Threading.Thread.Sleep(50); + //} + } + + public void Start() + { + var t = new Thread(StartSST); + t.Start(); + } + + public void Stop() + { + if (sre != null) + { + sre.RecognizeAsyncCancel(); + sre.RecognizeAsyncStop(); + kinectSource.Dispose(); + } + } + + void sre_SpeechRecognitionRejected(object sender, SpeechRecognitionRejectedEventArgs e) + { + var said = new TextRecognizedArgs(); + said.Verb = Verbs.None; + said.Matched = "?"; + TextRecognized(new object(), said); + Console.WriteLine("\nSpeech Rejected"); + } + + void sre_SpeechRecognized(object sender, SpeechRecognizedEventArgs e) + { + if (TextRecognized == null) + return; + + var said = new TextRecognizedArgs(); + said.Verb = Verbs.None; + said.Phrase = e.Result.Text; + + bool found = false; + foreach (var phrase in SinglePhrases) + { + if (e.Result.Text.Contains(phrase.Key)) + { + said.Verb = phrase.Value; + found = true; + break; + } + } + + if (!found) + return; + + TextRecognized(new object(), said); + } + } +} \ No newline at end of file diff --git a/Demo4/Demo4.sln b/Demo4/Demo4.sln new file mode 100644 index 0000000..a92b732 --- /dev/null +++ b/Demo4/Demo4.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo4", "Demo4\Demo4.csproj", "{FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC}.Debug|x86.ActiveCfg = Debug|x86 + {FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC}.Debug|x86.Build.0 = Debug|x86 + {FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC}.Release|x86.ActiveCfg = Release|x86 + {FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo4/Demo4/Demo4.csproj b/Demo4/Demo4/Demo4.csproj new file mode 100644 index 0000000..afac640 --- /dev/null +++ b/Demo4/Demo4/Demo4.csproj @@ -0,0 +1,60 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {FBF0FD4F-54D6-4077-AE63-F98C1FD10FBC} + Exe + Properties + Demo4 + Demo4 + v4.0 + Client + 512 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Demo4/Demo4/KeySender.cs b/Demo4/Demo4/KeySender.cs new file mode 100644 index 0000000..2a09e05 --- /dev/null +++ b/Demo4/Demo4/KeySender.cs @@ -0,0 +1,114 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; + +namespace KinectWorkshop +{ + public enum VirtualKey : ushort + { + SHIFT = 0x10, + CONTROL = 0x11, + MENU = 0x12, + ESCAPE = 0x1B, + BACK = 0x08, + TAB = 0x09, + RETURN = 0x0D, + PRIOR = 0x21, + NEXT = 0x22, + END = 0x23, + HOME = 0x24, + LEFT = 0x25, + UP = 0x26, + RIGHT = 0x27, + DOWN = 0x28, + SELECT = 0x29, + PRINT = 0x2A, + EXECUTE = 0x2B, + SNAPSHOT = 0x2C, + INSERT = 0x2D, + DELETE = 0x2E, + HELP = 0x2F, + NUMPAD0 = 0x60, + NUMPAD1 = 0x61, + NUMPAD2 = 0x62, + NUMPAD3 = 0x63, + NUMPAD4 = 0x64, + NUMPAD5 = 0x65, + NUMPAD6 = 0x66, + NUMPAD7 = 0x67, + NUMPAD8 = 0x68, + NUMPAD9 = 0x69, + MULTIPLY = 0x6A, + ADD = 0x6B, + SEPARATOR = 0x6C, + SUBTRACT = 0x6D, + DECIMAL = 0x6E, + DIVIDE = 0x6F, + F1 = 0x70, + F2 = 0x71, + F3 = 0x72, + F4 = 0x73, + F5 = 0x74, + F6 = 0x75, + F7 = 0x76, + F8 = 0x77, + F9 = 0x78, + F10 = 0x79, + F11 = 0x7A, + F12 = 0x7B, + OEM_1 = 0xBA, // ',:' for US + OEM_PLUS = 0xBB, // '+' any country + OEM_COMMA = 0xBC, // ',' any country + OEM_MINUS = 0xBD, // '-' any country + OEM_PERIOD = 0xBE, // '.' any country + OEM_2 = 0xBF, // '/?' for US + OEM_3 = 0xC0, // '`~' for US + MEDIA_NEXT_TRACK = 0xB0, + MEDIA_PREV_TRACK = 0xB1, + MEDIA_STOP = 0xB2, + MEDIA_PLAY_PAUSE = 0xB3, + LWIN =0x5B, + RWIN =0x5C + } + + class KeySender + { + [DllImport("user32.dll", SetLastError = true)] + static extern uint SendInput(uint nInputs, ref INPUT pInputs, int cbSize); + + public struct KEYBDINPUT + { + public ushort wVk; + public ushort wScan; + public uint dwFlags; + public long time; + public uint dwExtraInfo; + } + + [StructLayout(LayoutKind.Explicit, Size = 28)] + public struct INPUT + { + [FieldOffset(0)] + public uint type; + [FieldOffset(4)] + public KEYBDINPUT ki; + } + + public enum Win32Consts : int + { + INPUT_MOUSE = 0, + INPUT_KEYBOARD = 1, + INPUT_HARDWARE = 2, + } + + public static void Send(VirtualKey key) + { + INPUT structInput = new INPUT(); + structInput.type = (uint)Win32Consts.INPUT_KEYBOARD; + structInput.ki.wVk = (ushort)key; + SendInput(1, ref structInput, Marshal.SizeOf(structInput)); + } + } +} diff --git a/Demo4/Demo4/Program.cs b/Demo4/Demo4/Program.cs new file mode 100644 index 0000000..0fc7be4 --- /dev/null +++ b/Demo4/Demo4/Program.cs @@ -0,0 +1,54 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using Microsoft.Research.Kinect.Nui; + +namespace Demo4 +{ + class Program + { + private static DateTime lastTimeHit; + static void Main(string[] args) + { + if (Runtime.Kinects.Count == 0) + { + Console.WriteLine("Keine Kinect"); + return; + } + Runtime r = Runtime.Kinects[0]; + r.Initialize(RuntimeOptions.UseSkeletalTracking); + r.SkeletonEngine.TransformSmooth = true; + + r.SkeletonFrameReady += new EventHandler(r_SkeletonFrameReady); + + Console.ReadLine(); + r.Uninitialize(); + } + + static void r_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) + { + if ((DateTime.Now - lastTimeHit).Seconds < 5) + { + return; + } + foreach (SkeletonData s in e.SkeletonFrame.Skeletons) + { + if (s.TrackingState == SkeletonTrackingState.Tracked) + { + Joint rh = s.Joints[JointID.HandRight]; + Joint h = s.Joints[JointID.Head]; + + if (rh.Position.Y > h.Position.Y) + { + lastTimeHit = DateTime.Now; + Console.WriteLine("Hand über kopf"); + IntPtr hwnd = KinectWorkshop.WindowFinder.StartingWith("Unbenannt"); + KinectWorkshop.WindowFinder.SetFocusOn(hwnd); + KinectWorkshop.KeySender.Send(KinectWorkshop.VirtualKey.NEXT); + } + } + } + } + } +} diff --git a/Demo4/Demo4/Properties/AssemblyInfo.cs b/Demo4/Demo4/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..e7a4dc5 --- /dev/null +++ b/Demo4/Demo4/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo4")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo4")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("aa436451-b12f-49c9-aa04-728a278274ee")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo4/Demo4/WindowFinder.cs b/Demo4/Demo4/WindowFinder.cs new file mode 100644 index 0000000..546c3c6 --- /dev/null +++ b/Demo4/Demo4/WindowFinder.cs @@ -0,0 +1,55 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Runtime.InteropServices; + +namespace KinectWorkshop +{ + class WindowFinder + { + [DllImport("user32.dll", SetLastError = true)] + static extern IntPtr FindWindow(string lpClassName, string lpWindowName); + + [DllImport("user32.Dll")] + [return: MarshalAs(UnmanagedType.Bool)] + static extern bool EnumWindows(EnumWindowsProc lpEnumFunc, [MarshalAsAttribute(UnmanagedType.Struct)] ref SearchData data); + private delegate bool EnumWindowsProc(IntPtr hWnd, ref SearchData data); + + [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)] + public static extern int GetWindowText(IntPtr hWnd, StringBuilder lpString, int nMaxCount); + + [DllImport("user32.dll")] + static extern IntPtr SetFocus(IntPtr hWnd); + + struct SearchData + { + public string TitlePrefix; + public IntPtr hWnd; + } + + static bool EnumProc(IntPtr hWnd, ref SearchData data) + { + StringBuilder sb = new StringBuilder(1024); + GetWindowText(hWnd, sb, sb.Capacity); + if (sb.ToString().StartsWith(data.TitlePrefix)) + { + data.hWnd = hWnd; + return false; + } + return true; + } + + public static IntPtr StartingWith(string prefix) + { + SearchData sd = new SearchData { TitlePrefix = prefix }; + EnumWindows(new EnumWindowsProc(EnumProc), ref sd); + return sd.hWnd; + } + + public static void SetFocusOn(IntPtr hwnd) + { + SetFocus(hwnd); + } + } +} diff --git a/Demo5/Demo5.sln b/Demo5/Demo5.sln new file mode 100644 index 0000000..4a24f04 --- /dev/null +++ b/Demo5/Demo5.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo5", "Demo5\Demo5.csproj", "{CF078AB1-B658-48F7-89C1-45610E317B3D}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {CF078AB1-B658-48F7-89C1-45610E317B3D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CF078AB1-B658-48F7-89C1-45610E317B3D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CF078AB1-B658-48F7-89C1-45610E317B3D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CF078AB1-B658-48F7-89C1-45610E317B3D}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo5/Demo5/Class1.cs b/Demo5/Demo5/Class1.cs new file mode 100644 index 0000000..6f4e611 --- /dev/null +++ b/Demo5/Demo5/Class1.cs @@ -0,0 +1,11 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace Demo5 +{ + public class Class1 + { + } +} diff --git a/Demo5/Demo5/Demo5.csproj b/Demo5/Demo5/Demo5.csproj new file mode 100644 index 0000000..5bc7961 --- /dev/null +++ b/Demo5/Demo5/Demo5.csproj @@ -0,0 +1,81 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {CF078AB1-B658-48F7-89C1-45610E317B3D} + Library + Properties + Demo5 + Demo5 + v4.0 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + true + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + true + + + KinectDemo5.snk + + + + + + + + + + + + + + + + + + UserControl + + + KinectControl.cs + + + + + KinectControl.cs + + + + + + + + + + + \ No newline at end of file diff --git a/Demo5/Demo5/KinectControl.Designer.cs b/Demo5/Demo5/KinectControl.Designer.cs new file mode 100644 index 0000000..c6fda6d --- /dev/null +++ b/Demo5/Demo5/KinectControl.Designer.cs @@ -0,0 +1,72 @@ +namespace Demo5 +{ + partial class KinectControl + { + /// + /// Erforderliche Designervariable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Verwendete Ressourcen bereinigen. + /// + /// True, wenn verwaltete Ressourcen gelöscht werden sollen; andernfalls False. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Vom Komponenten-Designer generierter Code + + /// + /// Erforderliche Methode für die Designerunterstützung. + /// Der Inhalt der Methode darf nicht mit dem Code-Editor geändert werden. + /// + private void InitializeComponent() + { + this.lbHandLeft = new System.Windows.Forms.Label(); + this.lbHandRight = new System.Windows.Forms.Label(); + this.SuspendLayout(); + // + // lbHandLeft + // + this.lbHandLeft.AutoSize = true; + this.lbHandLeft.Location = new System.Drawing.Point(3, 15); + this.lbHandLeft.Name = "lbHandLeft"; + this.lbHandLeft.Size = new System.Drawing.Size(59, 13); + this.lbHandLeft.TabIndex = 0; + this.lbHandLeft.Text = "lbHandLeft"; + // + // lbHandRight + // + this.lbHandRight.AutoSize = true; + this.lbHandRight.Location = new System.Drawing.Point(84, 15); + this.lbHandRight.Name = "lbHandRight"; + this.lbHandRight.Size = new System.Drawing.Size(66, 13); + this.lbHandRight.TabIndex = 1; + this.lbHandRight.Text = "lbHandRight"; + // + // KinectControl + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.lbHandRight); + this.Controls.Add(this.lbHandLeft); + this.Name = "KinectControl"; + this.Size = new System.Drawing.Size(150, 46); + this.Load += new System.EventHandler(this.KinectControl_Load); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Label lbHandLeft; + private System.Windows.Forms.Label lbHandRight; + } +} diff --git a/Demo5/Demo5/KinectControl.cs b/Demo5/Demo5/KinectControl.cs new file mode 100644 index 0000000..d90e17a --- /dev/null +++ b/Demo5/Demo5/KinectControl.cs @@ -0,0 +1,90 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Drawing; +using System.Data; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using Microsoft.Win32; +using System.Reflection; +using Microsoft.Research.Kinect.Nui; + + +namespace Demo5 +{ + [ProgId("Demo5.KinectControl")] + [Guid("577410DD-1FC4-4B28-A0FE-9D0F78CEEDB5")] + [ClassInterface(ClassInterfaceType.AutoDual)] + [ComVisible(true)] + public partial class KinectControl : UserControl + { + private string text; + [ComRegisterFunction()] + public static void RegisterClass(string key) + { + StringBuilder sb = new StringBuilder(key); + sb.Replace(@"HKEY_CLASSES_ROOT\", ""); + + RegistryKey k = Registry.ClassesRoot.OpenSubKey(sb.ToString(), true); + RegistryKey ctrl = k.CreateSubKey("Control"); + ctrl.Close(); + + RegistryKey inprocServer32 = k.OpenSubKey("InprocServer32", true); + inprocServer32.SetValue("CodeBase", Assembly.GetExecutingAssembly().CodeBase); + inprocServer32.Close(); + + k.Close(); + } + + [ComUnregisterFunction()] + public static void UnregisterClass(string key) + { + StringBuilder sb = new StringBuilder(key); + sb.Replace(@"HKEY_CLASSES_ROOT\", ""); + + RegistryKey k = Registry.ClassesRoot.OpenSubKey(sb.ToString(), true); + k.DeleteSubKey("Control", false); + RegistryKey inprocServer32 = k.OpenSubKey("InprocServer32", true); + inprocServer32.DeleteSubKey("CodeBase", false); + inprocServer32.Close(); + k.Close(); + } + + + + public KinectControl() + { + InitializeComponent(); + } + + private void KinectControl_Load(object sender, EventArgs e) + { + Runtime r = Runtime.Kinects[0]; + r.Initialize(RuntimeOptions.UseSkeletalTracking); + r.SkeletonEngine.TransformSmooth = true; + r.SkeletonFrameReady += new EventHandler(r_SkeletonFrameReady); + } + + void r_SkeletonFrameReady(object sender, SkeletonFrameReadyEventArgs e) + { + foreach (SkeletonData s in e.SkeletonFrame.Skeletons) + { + if (s.TrackingState == SkeletonTrackingState.Tracked) + { + Joint lh = s.Joints[JointID.HandLeft]; + this.text = String.Format("X: {0}, Y: {1}", lh.Position.X, lh.Position.Y); + this.Invoke(new CallMe(SetText)); + } + } + } + + void SetText() + { + lbHandLeft.Text = this.text; + } + + delegate void CallMe(); + } +} diff --git a/Demo5/Demo5/KinectControl.resx b/Demo5/Demo5/KinectControl.resx new file mode 100644 index 0000000..29dcb1b --- /dev/null +++ b/Demo5/Demo5/KinectControl.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/Demo5/Demo5/KinectDemo5.snk b/Demo5/Demo5/KinectDemo5.snk new file mode 100644 index 0000000..eb5081d Binary files /dev/null and b/Demo5/Demo5/KinectDemo5.snk differ diff --git a/Demo5/Demo5/Properties/AssemblyInfo.cs b/Demo5/Demo5/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..d845721 --- /dev/null +++ b/Demo5/Demo5/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo5")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo5")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird +[assembly: Guid("75922dfb-1c32-4750-9af7-48d92b2c969d")] + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo5/Demo5/TextFile1.txt b/Demo5/Demo5/TextFile1.txt new file mode 100644 index 0000000..dfd1e08 --- /dev/null +++ b/Demo5/Demo5/TextFile1.txt @@ -0,0 +1,2 @@ +regasm demo.dll +regasm /u demo.dll \ No newline at end of file diff --git a/Demo6/Demo6.sln b/Demo6/Demo6.sln new file mode 100644 index 0000000..08cd81d --- /dev/null +++ b/Demo6/Demo6.sln @@ -0,0 +1,20 @@ + +Microsoft Visual Studio Solution File, Format Version 11.00 +# Visual Studio 2010 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Demo6", "Demo6\Demo6.csproj", "{9775B675-99C5-4DAD-8F6E-757002AE51D4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x86 = Debug|x86 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {9775B675-99C5-4DAD-8F6E-757002AE51D4}.Debug|x86.ActiveCfg = Debug|x86 + {9775B675-99C5-4DAD-8F6E-757002AE51D4}.Debug|x86.Build.0 = Debug|x86 + {9775B675-99C5-4DAD-8F6E-757002AE51D4}.Release|x86.ActiveCfg = Release|x86 + {9775B675-99C5-4DAD-8F6E-757002AE51D4}.Release|x86.Build.0 = Release|x86 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Demo6/Demo6/App.xaml b/Demo6/Demo6/App.xaml new file mode 100644 index 0000000..1fbe808 --- /dev/null +++ b/Demo6/Demo6/App.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Demo6/Demo6/App.xaml.cs b/Demo6/Demo6/App.xaml.cs new file mode 100644 index 0000000..1fa19ce --- /dev/null +++ b/Demo6/Demo6/App.xaml.cs @@ -0,0 +1,16 @@ +using System; +using System.Collections.Generic; +using System.Configuration; +using System.Data; +using System.Linq; +using System.Windows; + +namespace Demo6 +{ + /// + /// Interaktionslogik für "App.xaml" + /// + public partial class App : Application + { + } +} diff --git a/Demo6/Demo6/Demo6.csproj b/Demo6/Demo6/Demo6.csproj new file mode 100644 index 0000000..742c6cd --- /dev/null +++ b/Demo6/Demo6/Demo6.csproj @@ -0,0 +1,104 @@ + + + + Debug + x86 + 8.0.30703 + 2.0 + {9775B675-99C5-4DAD-8F6E-757002AE51D4} + WinExe + Properties + Demo6 + Demo6 + v4.0 + Client + 512 + {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 4 + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + 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/Demo6/Demo6/MainWindow.xaml b/Demo6/Demo6/MainWindow.xaml new file mode 100644 index 0000000..adccc6e --- /dev/null +++ b/Demo6/Demo6/MainWindow.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/Demo6/Demo6/MainWindow.xaml.cs b/Demo6/Demo6/MainWindow.xaml.cs new file mode 100644 index 0000000..483cb47 --- /dev/null +++ b/Demo6/Demo6/MainWindow.xaml.cs @@ -0,0 +1,50 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +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; +using Microsoft.Research.Kinect.Nui; + +namespace Demo6 +{ + /// + /// Interaktionslogik für MainWindow.xaml + /// + public partial class MainWindow : Window + { + public MainWindow() + { + InitializeComponent(); + } + + private void Window_Loaded(object sender, RoutedEventArgs e) + { + if (Runtime.Kinects.Count == 0) + { + MessageBox.Show("Keine Kinect"); + return; + } + Runtime r = Runtime.Kinects[0]; + r.Initialize(RuntimeOptions.UseDepth); + r.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.Depth); + r.DepthFrameReady += new EventHandler(r_DepthFrameReady); + } + + void r_DepthFrameReady(object sender, ImageFrameReadyEventArgs e) + { + PlanarImage img = e.ImageFrame.Image; + //byte[] b = cv.ConvertDepthFrame(img.Bits); + imgDepth.Source = BitmapSource.Create(img.Width, img.Height, + 96, 96, PixelFormats.Bgr32, null, + b, img.Width * img.BytesPerPixel); + } + } +} diff --git a/Demo6/Demo6/Properties/AssemblyInfo.cs b/Demo6/Demo6/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..6994f30 --- /dev/null +++ b/Demo6/Demo6/Properties/AssemblyInfo.cs @@ -0,0 +1,55 @@ +using System.Reflection; +using System.Resources; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; +using System.Windows; + +// Allgemeine Informationen über eine Assembly werden über die folgenden +// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern, +// die mit einer Assembly verknüpft sind. +[assembly: AssemblyTitle("Demo6")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Demo6")] +[assembly: AssemblyCopyright("Copyright © 2011")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Durch Festlegen von ComVisible auf "false" werden die Typen in dieser Assembly unsichtbar +// für COM-Komponenten. Wenn Sie auf einen Typ in dieser Assembly von +// COM zugreifen müssen, legen Sie das ComVisible-Attribut für diesen Typ auf "true" fest. +[assembly: ComVisible(false)] + +//Um mit dem Erstellen lokalisierbarer Anwendungen zu beginnen, legen Sie +//ImCodeVerwendeteKultur in der .csproj-Datei +//in einer fest. Wenn Sie in den Quelldateien beispielsweise Deutsch +//(Deutschland) verwenden, legen Sie auf \"de-DE\" fest. Heben Sie dann die Auskommentierung +//des nachstehenden NeutralResourceLanguage-Attributs auf. Aktualisieren Sie "en-US" in der nachstehenden Zeile, +//sodass es mit der UICulture-Einstellung in der Projektdatei übereinstimmt. + +//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)] + + +[assembly: ThemeInfo( + ResourceDictionaryLocation.None, //Speicherort der designspezifischen Ressourcenwörterbücher + //(wird verwendet, wenn eine Ressource auf der Seite + // oder in den Anwendungsressourcen-Wörterbüchern nicht gefunden werden kann.) + ResourceDictionaryLocation.SourceAssembly //Speicherort des generischen Ressourcenwörterbuchs + //(wird verwendet, wenn eine Ressource auf der Seite, in der Anwendung oder einem + // designspezifischen Ressourcenwörterbuch nicht gefunden werden kann.) +)] + + +// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten: +// +// Hauptversion +// Nebenversion +// Buildnummer +// Revision +// +// Sie können alle Werte angeben oder die standardmäßigen Build- und Revisionsnummern +// übernehmen, indem Sie "*" eingeben: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/Demo6/Demo6/Properties/Resources.Designer.cs b/Demo6/Demo6/Properties/Resources.Designer.cs new file mode 100644 index 0000000..e81ad4b --- /dev/null +++ b/Demo6/Demo6/Properties/Resources.Designer.cs @@ -0,0 +1,71 @@ +//------------------------------------------------------------------------------ +// +// Dieser Code wurde von einem Tool generiert. +// Laufzeitversion:4.0.30319.239 +// +// Änderungen an dieser Datei können fehlerhaftes Verhalten verursachen und gehen verloren, wenn +// der Code neu generiert wird. +// +//------------------------------------------------------------------------------ + +namespace Demo6.Properties +{ + + + /// + /// Eine stark typisierte Ressourcenklasse zum Suchen von lokalisierten Zeichenfolgen usw. + /// + // Diese Klasse wurde von der StronglyTypedResourceBuilder-Klasse + // über ein Tool wie ResGen oder Visual Studio automatisch generiert. + // Um einen Member hinzuzufügen oder zu entfernen, bearbeiten Sie die .ResX-Datei und führen dann ResGen + // mit der Option /str erneut aus, oder erstellen Sie Ihr VS-Projekt neu. + [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() + { + } + + /// + /// Gibt die zwischengespeicherte ResourceManager-Instanz zurück, die von dieser Klasse verwendet wird. + /// + [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("Demo6.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Überschreibt die CurrentUICulture-Eigenschaft des aktuellen Threads für alle + /// Ressourcenlookups, die diese stark typisierte Ressourcenklasse verwenden. + /// + [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/Demo6/Demo6/Properties/Resources.resx b/Demo6/Demo6/Properties/Resources.resx new file mode 100644 index 0000000..ffecec8 --- /dev/null +++ b/Demo6/Demo6/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/Demo6/Demo6/Properties/Settings.Designer.cs b/Demo6/Demo6/Properties/Settings.Designer.cs new file mode 100644 index 0000000..9f65ea1 --- /dev/null +++ b/Demo6/Demo6/Properties/Settings.Designer.cs @@ -0,0 +1,30 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.239 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Demo6.Properties +{ + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.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/Demo6/Demo6/Properties/Settings.settings b/Demo6/Demo6/Properties/Settings.settings new file mode 100644 index 0000000..8f2fd95 --- /dev/null +++ b/Demo6/Demo6/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file