本文整理汇总了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();
}
}
示例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;
}
}
}
示例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);
}
}
}
示例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;
}
}
}
示例5: UninitializeKinect
private void UninitializeKinect(KinectSensor kinectSensor)
{
this.UninitializeSpeechRecognitionEngine(kinectSensor);
kinectSensor.Stop();
kinectSensor.Dispose();
}
示例6: StopKinect
private void StopKinect(KinectSensor sensor)
{
if (sensor != null)
{
sensor.Stop();
sensor.AudioSource.Stop();
sensor.Dispose();
}
}
示例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;
}
}
}
示例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;
}
}
}
示例9: Disable
public static void Disable(KinectSensor sensor)
{
sensor.AudioSource.Stop();
sensor.ColorStream.Disable();
sensor.DepthStream.Disable();
sensor.Stop();
sensor.Dispose();
}
示例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();
}
}
}
示例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
}
}
示例12: StopKinect
private void StopKinect(KinectSensor kinect)
{
if (kinect != null)
{
if (kinect.IsRunning)
{
//kinectの停止
kinect.Stop();
kinect.Dispose();
}
}
}
示例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;
}
}
}
示例14: UninitializeKinect
private void UninitializeKinect(KinectSensor kinectSensor)
{
kinectSensor.Stop();
kinectSensor.Dispose();
this.mCurrentKinectSensor = null;
}