Upon running or debugging the application, you will see a gray screen, because there
is nothing yet in the application to show. Back in Visual Studio, select the menu
DEBUG, Stop Debugging or click the Red Stop Square in the Debugging toolbar.
In the future, the steps 7 and 8 are required when asked to Build and Run the
application.
8.
Open the MainPage.xaml.cs code behind file in Visual Studio by double clicking it.9.
To get the default sensor for the Kinect, add the WindowsPreview.Kinect namespace,
and a private class level variable for the KinectSensor. Then in the constructor of
MainPage class select the default sensor and open it. To do this, add the highlighted
code below:
10.
// ... other namespaces
using WindowsPreview.Kinect;
namespace Kinect2Sample
{
public sealed partial class MainPage : Page
{
private KinectSensor kinectSensor = null;
public MainPage()
{
// one sensor is currently supported
this.kinectSensor = KinectSensor.GetDefault();
// open the sensor
this.kinectSensor.Open();
this.InitializeComponent();
}
}
}
Now add the Capability for the application to use the Kinect as a webcam and
microphone device. Open the Package.appxmanifest by double clicking it in the
Solution Explorer. Navigate to the Capabilities tab, then tick the Microphone and
Webcam capabilities:
11.
评论0
最新资源