/// <summary> /// occurs in visual when a skeleton frame is ready /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void visual_SkeletonReady(object sender, SkeletonEventArgs e) { if (e.skeletonFrame != null) { uiDispatcher.BeginInvoke(new UpdateEllipsesDelegate(UpdateEllipses), e); } }
/// <summary> /// occurs when a skeletonFrame is ready /// </summary> /// <param name="sender">the kinect manager</param> /// <param name="e">the skeleton event args</param> private void kinectMgr_SkeletonReady(object sender, SkeletonEventArgs e) { //send the skeleton to the gesture manager GestureMgr.skeleton = e.activeSkeleton; //send it to the client if (e.activeSkeleton != null) { ServerHelper.Send(new Message(new SkeletonInformation(e.activeSkeleton))); } }
/// <summary> /// the delegated method /// </summary> /// <param name="skeletonEvent">the skeleton Event Args from the Kinect</param> private void UpdateEllipses(SkeletonEventArgs skeletonEvent) { using (SkeletonFrame skeletonFrame = skeletonEvent.skeletonFrame) { ClearCanvasFromSkeleton(); if (skeletonFrame != null) { if (skeletonEvent.activeSkeleton != null && skeletonEvent.activeSkeleton.TrackingState != SkeletonTrackingState.NotTracked) { skeletonCanvas.DrawSkeleton(skeletonEvent.activeSkeleton, Brushes.LightGreen); } } } }