寻求帮助:启动Kinect的功能 [英] Ask for help: Function to start the Kinect

查看:76
本文介绍了寻求帮助:启动Kinect的功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


   我为Kinect创建了一个项目,它有一个启动按钮来启动kinect和一个停止按钮来停止kinect。问题是当我按下停止按钮停止kinect然后点击开始按钮。 kinect永远不会开始。
以下是代码:


private void StartButton_Click(object sender,RoutedEventArgs s)


{


   if(this.Kinect!= null)


  {


  这个。 Kinect.Start();


  }


}



private void StopButton_Click(object sender,RoutedEventArgs e)


{


if(this.Kinect!= null)


{


this.Kinect.Stop();


this.Kinect.Dispose();


this._Kinect = null;


}


}


谢谢

解决方案

< blockquote>嗯,你停止时设置this._Kinect = null,然后检查StartButton中是否(this.Kinect!= null)


Hi All,

    I create a project for Kinect which has a start button to start the kinect and a stop button to stop the kinect. The problem is when I hit the stop button to stop the kinect and then hit the start button. The kinect would never start. Here is the code:

private void StartButton_Click(object sender, RoutedEventArgs s)

{

   if(this.Kinect!=null)

  {

   this. Kinect.Start();

  }

}

private void StopButton_Click(object sender, RoutedEventArgs e)

{

if (this.Kinect != null)

{

this.Kinect.Stop();

this.Kinect.Dispose();

this._Kinect = null;

}

}

Thank you

解决方案

well, you set this._Kinect = null when you stop, and then check if(this.Kinect!=null) in StartButton


这篇关于寻求帮助:启动Kinect的功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆