private void Initialize() { if (kinectRuntime == null) { return; } kinectRuntime.Initialize(RuntimeOptions.UseSkeletalTracking | RuntimeOptions.UseColor); kinectRuntime.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color); kinectRuntime.VideoFrameReady += new EventHandler <ImageFrameReadyEventArgs>(kinectRuntime_VideoFrameReady); kinectRuntime.SkeletonFrameReady += new EventHandler <SkeletonFrameReadyEventArgs>(kinectRuntime_SkeletonFrameReady); skeletonDisplayManager = new SkeletonDisplayManager(kinectRuntime.SkeletonEngine, kinectCanvas); gestureRecognizer.TraceTo(gesturesCanvas, System.Windows.Media.Color.FromRgb(255, 0, 0)); gestureRecognizer.OnGestureDetected += new Action <string>(OnGestureDetected); gestureRecognizer.MinimalPeriodBetweenGestures = 2000; }