public void StartDisplay(TravelOffer lastTravel) { _currentOffer = lastTravel; try { InitializeComponent(); InitList(); var helper = KinectHelper.Instance; helper.ReadyEvent += (s, _) => HelperReady(); GreenScreen.Start(helper.Sensor, false); SetNewHat(); Accessories.Start(helper.Sensor); RectNavigationControl.Start(helper.Sensor); RectNavigationControl.SwipeLeftEvent += SwipeLeft; RectNavigationControl.SwipeRightEvent += SwipeRight; RectNavigationControl.SwipeUpEvent += SwipeUp; RectNavigationControl.SwipeDownEvent += SwipeDown; RectNavigationControl.NoSwipe += NoSwipe; string[] texts = MyTextLoopList.GetNeighbourTexts(); RectNavigationControl.SetTopText(texts[0]); RectNavigationControl.SetBottomText(texts[1]); InitGenderDetection(); } catch (Exception exc) { ExceptionTextBlock.Text = exc.Message + "\r\n" + exc.InnerException + "\r\n" + exc.StackTrace; } }
/*Erst wenn die Scrollanimation der TextLoopList beendet ist, darf die LoopList weiterscrollen (vertical).*/ private void MyTextLoopList_Scrolled(object sender, EventArgs e) { _waitForTextList = false; if (!_unclicked) { _doDrag = true; } string[] texts = MyTextLoopList.GetNeighbourTexts(); RectNavigationControl.SetTopText(texts[0]); RectNavigationControl.SetBottomText(texts[1]); }
/*Callback fur ein fertiges Frame vom Kinect-Sensor*/ private void HelperReady() { var helper = KinectHelper.Instance; Skeleton skeleton = helper.GetFixedSkeleton(); if (skeleton != null) { RectNavigationControl.GestureRecognition(skeleton); } GreenScreen.RenderImageData(helper.DepthImagePixels, helper.ColorPixels); SetAccessoriesNew(helper); KinectHelper.Instance.SetTransform(GreenScreen); KinectHelper.Instance.SetTransform(Accessories); KinectHelper.Instance.SetTransform(RectNavigationControl); }