本文整理汇总了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();
}
示例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);
}
}
}
示例3: Initialize
public void Initialize()
{
if (initialized)
{
return;
}
// test Kinect
Runtime runtime = new Runtime();
runtime.Initialize(RuntimeOptions.UseSkeletalTracking);
runtime.Uninitialize();
initialized = true;
}
示例4: DisableOrAddKinectViewer
private void DisableOrAddKinectViewer(Runtime runtime)
{
var foundViewer = FindViewer(runtime);
if (foundViewer != null)
{
runtime.Uninitialize();
}
else
{
AddKinectViewer(runtime);
}
}
示例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;
}
}
示例6: Uninitialize
private static void Uninitialize(Runtime kinect)
{
kinect.Uninitialize();
kinect.SkeletonFrameReady -= new EventHandler<SkeletonFrameReadyEventArgs>(SkeletonsReady);
}