当前位置: 首页>>代码示例>>C#>>正文


C# Runtime.Uninitialize方法代码示例

本文整理汇总了C#中Runtime.Uninitialize方法的典型用法代码示例。如果您正苦于以下问题:C# Runtime.Uninitialize方法的具体用法?C# Runtime.Uninitialize怎么用?C# Runtime.Uninitialize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Runtime的用法示例。


在下文中一共展示了Runtime.Uninitialize方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Window_Loaded

        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            Runtime kinectRuntime = new Runtime();

            kinectRuntime.Initialize(RuntimeOptions.UseDepthAndPlayerIndex | RuntimeOptions.UseSkeletalTracking);
            kinectRuntime.DepthStream.Open(ImageStreamType.Depth, 2, ImageResolution.Resolution320x240, ImageType.DepthAndPlayerIndex);

            kinectRuntime.SkeletonFrameReady += kinectRuntime_SkeletonFrameReady;
            kinectRuntime.DepthFrameReady += kinectRuntime_DepthFrameReady;

            kinectRuntime.SkeletonEngine.TransformSmooth = true;

            var parameters = new TransformSmoothParameters
            {
                Smoothing = 0.75f,
                Correction = 0.0f,
                Prediction = 0.0f,
                JitterRadius = 0.05f,
                MaxDeviationRadius = 0.04f
            };
            kinectRuntime.SkeletonEngine.SmoothParameters = parameters;

            using (game = new Game1())
            {
                game.Exiting += game_Exiting;
                game.Run();
            }

            kinectRuntime.Uninitialize();
        }
开发者ID:ProjPossibility,项目名称:USC-AccessibleKinect,代码行数:30,代码来源:MainWindow.xaml.cs

示例2: buttonStart_Click

        private void buttonStart_Click(object sender, EventArgs e)
        {
            _nui = Runtime.Kinects.FirstOrDefault();
              if (_nui != null)
              {
            if (buttonStart.Text == Resources.Form1_buttonStart_Click_Start)
            {
              buttonStart.Text = Resources.Form1_buttonStart_Click_Stop;

              _nui.Initialize(RuntimeOptions.UseColor);
              _nui.VideoStream.Open(ImageStreamType.Video, 2, ImageResolution.Resolution640x480, ImageType.Color);

              _nui.VideoFrameReady += FrameReady;
            }
            else if (buttonStart.Text == Resources.Form1_buttonStart_Click_Stop)
            {
              buttonStart.Text = Resources.Form1_buttonStart_Click_Start;
              _nui.Uninitialize();
            }
              }
              else
              {
            var dr = MessageBox.Show(Resources.Form1_buttonStart_Click_Please_connect_a_Microsoft_Kinect_to_the_computer,
                                 Resources.Form1_buttonStart_Click_Error, MessageBoxButtons.RetryCancel);
            if (dr == DialogResult.Retry)
            {
              buttonStart_Click(sender, e);
            }
              }
        }
开发者ID:felixpp,项目名称:KinectTester,代码行数:30,代码来源:KinectTesterForm.cs

示例3: Initialize

        public void Initialize()
        {
            if (initialized)
            {
                return;
            }

            // test Kinect
            Runtime runtime = new Runtime();
            runtime.Initialize(RuntimeOptions.UseSkeletalTracking);
            runtime.Uninitialize();

            initialized = true;
        }
开发者ID:chancancode,项目名称:KinectPresenter,代码行数:14,代码来源:GestureEngine.cs

示例4: DisableOrAddKinectViewer

        private void DisableOrAddKinectViewer(Runtime runtime)
        {
            var foundViewer = FindViewer(runtime);

            if (foundViewer != null)
            {
                runtime.Uninitialize();
            }
            else
            {
                AddKinectViewer(runtime);
            }
        }
开发者ID:bbasseri,项目名称:Kinect-Windows-Pixelation-hack,代码行数:13,代码来源:MainWindow.xaml.cs

示例5: EngineWorker

        private void EngineWorker()
        {
            Runtime engine = new Runtime();

            foreach (IGestureRecognizer recognizer in recognizers)
            {
                recognizer.GestureRecognized += OnGestureRecognized;
            }

            engine.SkeletonFrameReady += OnSkeletonFrameReady;
            engine.Initialize(RuntimeOptions.UseSkeletalTracking);

            engineLock.WaitOne();

            engine.Uninitialize();
            engine.SkeletonFrameReady -= OnSkeletonFrameReady;

            foreach (IGestureRecognizer recognizer in recognizers)
            {
                recognizer.GestureRecognized -= OnGestureRecognized;
            }
        }
开发者ID:chancancode,项目名称:KinectPresenter,代码行数:22,代码来源:GestureEngine.cs

示例6: Uninitialize

 private static void Uninitialize(Runtime kinect)
 {
     kinect.Uninitialize();
     kinect.SkeletonFrameReady -= new EventHandler<SkeletonFrameReadyEventArgs>(SkeletonsReady);
 }
开发者ID:marshally,项目名称:WebKinect,代码行数:5,代码来源:Kinect.cs


注:本文中的Runtime.Uninitialize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。