我已下载Kinect SDK 1.7,工具包,并使用以下示例.
我发现Kinect Toolkit在内部使用交互框架来检测手部位置/手势,并相应地将其映射到Kinect控件.
我有一个要求,我想在Kinect平铺按钮上捕获一个抓握事件.由于默认的KinectTileButton不提供Grip事件.我在我的按钮上添加了一个grip事件处理程序.
KinectRegion.AddHandPointerGripHandler(kinectButton, OnHandPointerCaptured);
private void OnHandPointerCaptured(object sender, HandPointerEventArgs handPointerEventArgs)
{
// Add code here
}
Run Code Online (Sandbox Code Playgroud)
我在OnHandPointerCaptured方法中放置了一个调试断点,当我抓住KinectTileButton时能够接收到正确的命中.但由于某种原因,我没有看到KinectCursor图像在KinectScrollViewer控件上发生变化.我尝试在KinectButtonBase类中设置isGripTarget属性,但它没有帮助.
private void InitializeKinectButtonBase()
{
KinectRegion.AddHandPointerPressHandler(this, this.OnHandPointerPress);
KinectRegion.AddHandPointerGotCaptureHandler(this, this.OnHandPointerCaptured);
KinectRegion.AddHandPointerPressReleaseHandler(this, this.OnHandPointerPressRelease);
KinectRegion.AddHandPointerLostCaptureHandler(this, this.OnHandPointerLostCapture);
KinectRegion.AddHandPointerEnterHandler(this, this.OnHandPointerEnter);
KinectRegion.AddHandPointerLeaveHandler(this, this.OnHandPointerLeave);
// Use the same OnHandPointerPress handler for the grip event
KinectRegion.AddHandPointerGripHandler(this, this.OnHandPointerPress);
//Set Kinect button as Grip target
// KinectRegion.SetIsPressTarget(this, true);
KinectRegion.SetIsGripTarget(this, true);
}
Run Code Online (Sandbox Code Playgroud)
如何将KinectCursor图像从openhand图标更改为grip,以及尺寸.