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


C# KinectSensor.Dispose方法代码示例

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


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

示例1: StopKinect

 /// <summary>
 /// Kinectの動作を停止する
 /// </summary>
 /// <param name="kinect"></param>
 private static void StopKinect( KinectSensor kinect )
 {
     if ( kinect.IsRunning ) {
         kinect.Stop();
         kinect.Dispose();
     }
 }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:11,代码来源:MainWindow.xaml.cs

示例2: StopKinect

        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              // 音声のスレッドを停止する
              isContinue = false;

              // フレーム更新イベントを削除する
              kinect.ColorFrameReady -= kinect_ColorFrameReady;
              kinect.DepthFrameReady -= kinect_DepthFrameReady;
              kinect.SkeletonFrameReady -= kinect_SkeletonFrameReady;

              // Kinectの停止と、ネイティブリソースを解放する
              kinect.Stop();
              kinect.Dispose();

              imageRgb.Source = null;
              imageDepth.Source = null;
            }
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:25,代码来源:MainWindow.xaml.cs

示例3: Evaluate

		public void Evaluate(int SpreadMax)
		{
			if (FInEnabled.IsChanged)
			{
				if (FInEnabled[0])
				{
					try
					{
						FSensor = FindSensor();
						FSensor.Start();
						FSensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30);
						FSensor.DepthStream.Enable(DepthImageFormat.Resolution640x480Fps30);
						EnableSkeletonStream();							
						FSensor.AllFramesReady += FSensor_AllFramesReady;
					}
					catch (Exception e)
					{
						if (FSensor != null)
						{
							FSensor.Dispose();
							FSensor = null;
						}
						FOutStatus[0] = e.Message;
					}
				}
				else
				{
					if (FSensor != null)
					{
						FSensor.AllFramesReady -= FSensor_AllFramesReady;
						FSensor.Stop();
						FSensor.Dispose();
						FSensor = null;
					}
				}

				FOutContext[0] = new FullHouseContext(this);
			}

			if (FInSkeletonSmoothing.IsChanged)
			{
				if (FSensor != null)
				{
					EnableSkeletonStream();
				}
			}

			if (FTimestampInvalidate)
			{
				FOutFrameNumber[0] = FFrameNumber;
				FOutTimestamp[0] = ( (double) FTimestamp) / 1000.0;
				FTimestampInvalidate = false;
			}

			if (FSkeletonInvalidate)
			{
				FOutSkeleton.SliceCount = 0;
				foreach (var skeleton in FSkeletonData)
				{
					if (skeleton.TrackingId > 0)
						FOutSkeleton.Add(skeleton);
				}
			}
		}
开发者ID:elliotwoods,项目名称:VVVV.Nodes.KinectFindBoard,代码行数:64,代码来源:FullHouse.cs

示例4: StopKinect

        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              // フレーム更新イベントを削除する
              kinect.AllFramesReady -= kinect_AllFramesReady;

              // Kinectの停止と、ネイティブリソースを解放する
              kinect.Stop();
              kinect.Dispose();

              imageRgb.Source = null;
            }
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:19,代码来源:MainWindow.xaml.cs

示例5: UninitializeKinect

 private void UninitializeKinect(KinectSensor kinectSensor)
 {
     this.UninitializeSpeechRecognitionEngine(kinectSensor);
     kinectSensor.Stop();
     kinectSensor.Dispose();
 }
开发者ID:drksugi,项目名称:KinectBreakout,代码行数:6,代码来源:MainWindow.xaml.cs

示例6: StopKinect

        private void StopKinect(KinectSensor sensor)
        {
            if (sensor != null)
            {

                sensor.Stop();
                sensor.AudioSource.Stop();
                sensor.Dispose();
            }
        }
开发者ID:asish-aryal,项目名称:KSE,代码行数:10,代码来源:KinectHandler.cs

示例7: StopKinect

        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              kinect.AllFramesReady -= kinect_AllFramesReady;

              kinect.Stop();
              kinect.Dispose();
              kinect = null;

              pictureBoxRgb.Image = null;
              pictureBoxDepth.Image = null;
            }
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:19,代码来源:Form1.cs

示例8: StopKinect

        /// <summary>
        /// Kinectの動作を停止する
        /// </summary>
        /// <param name="kinect"></param>
        private void StopKinect( KinectSensor kinect )
        {
            if ( kinect != null ) {
            if ( kinect.IsRunning ) {
              // Kinectの停止と、ネイティブリソースを解放する
              kinect.Stop();
              kinect.Dispose();

              imageRgb.Source = null;
            }
              }
        }
开发者ID:hatsunea,项目名称:KinectSDKBook4CS,代码行数:16,代码来源:MainWindow.xaml.cs

示例9: Disable

 public static void Disable(KinectSensor sensor)
 {
     sensor.AudioSource.Stop();
     sensor.ColorStream.Disable();
     sensor.DepthStream.Disable();
     sensor.Stop();
     sensor.Dispose();
 }
开发者ID:TheSpikesKinectors,项目名称:SecondGame2016,代码行数:8,代码来源:Kinecterface.cs

示例10: StopKinect

        private void StopKinect(KinectSensor sensor)
        {
            if (sensor != null)
            {
                if (sensor.IsRunning)
                {
                    //stop sensor
                    sensor.Stop();

                    //stop audio if not null
                    if (sensor.AudioSource != null)
                    {
                        sensor.AudioSource.Stop();
                    }

                    sensor.Dispose();
                }
            }
        }
开发者ID:Apolotary,项目名称:Kinesthesia,代码行数:19,代码来源:MainWindow.xaml.cs

示例11: UninitializeKinectSensor

        private void UninitializeKinectSensor(KinectSensor sensor)
        {
            if (sensor != null)
            {
                sensor.Stop();
                //sensor.DepthFrameReady -= Kinect_DepthFrameReady;
                sensor.ColorFrameReady -= Kinect_ColorFrameReady;
                sensor.SkeletonFrameReady -= Kinect_SkeletonFrameReady;
                sensor.Dispose();
                sensor = null;

                SkeletonViewerElement.KinectDevice = null; //TEST WITH skeleton viewer
            }
        }
开发者ID:Kazhunter,项目名称:Kinect,代码行数:14,代码来源:MainWindow.xaml.cs

示例12: StopKinect

 private void StopKinect(KinectSensor kinect)
 {
     if (kinect != null)
     {
         if (kinect.IsRunning)
         {
             //kinectの停止
             kinect.Stop();
             kinect.Dispose();
         }
     }
 }
开发者ID:sugasaki,项目名称:kinect4excel,代码行数:12,代码来源:kinectvba.cs

示例13: StopKinect

        private void StopKinect(KinectSensor Kinect)
        {
            if (Kinect != null)
            {
                if (Kinect.IsRunning)
                {
                    // フレーム更新イベントを削除する
                    Kinect.ColorFrameReady -= Kinect_ColorFrameReady;
                    Kinect.DepthFrameReady -= Kinect_DepthFrameReady;
                    Kinect.SkeletonFrameReady -= Kinect_SkeletonFrameReady;

                    // Kinectの停止と、ネイティブリソースのを解放する
                    Kinect.Stop();
                    Kinect.Dispose();

                    imageRgb.Source = null;
                    imageDepth.Source = null;
                }
            }
        }
开发者ID:hrtkht,项目名称:TestKinect,代码行数:20,代码来源:MainWindow.xaml.cs

示例14: UninitializeKinect

 private void UninitializeKinect(KinectSensor kinectSensor)
 {
     kinectSensor.Stop();
     kinectSensor.Dispose();
     this.mCurrentKinectSensor = null;
 }
开发者ID:drksugi,项目名称:KinectFallGame,代码行数:6,代码来源:MainWindow.xaml.cs


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