Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Infrared Basics-D2D C++ Sample

Infrared Basics-D2D C++ Sample

Kinect for Windows 1.6, 1.7, 1.8


Demonstrates how to enable the depth camera to transmit invisible infrared light and displays a real-time image of the resulting Infrared Stream.

For more information about the code used in the sample, see Getting and Displaying Infrared Data in C#.

The Sample Uses the Following APIsTo Do This
NuiGetSensorCountGet the number of sensors that are ready for use.
NuiCreateSensorByIndex and INuiSensor interfaceCreate an interface that represents a connected sensor.
INuiSensor::NuiStatus MethodCheck the sensor status to see if the sensor is connected.
INuiSensor::NuiInitialize Method and NUI_INITIALIZE_FLAG_USES_COLOR constantInitialize the sensor to stream out color data.
CreateEvent FunctionCreate an event that will be signaled when color data is available by returning an event handle.
INuiSensor::NuiImageStreamOpen Method, NUI_IMAGE_TYPE_COLOR_INFRARED constant, NUI_IMAGE_RESOLUTION_640x480 constant, and the event handleOpen an infrared stream to receive infrared data.
INuiSensor::NuiImageStreamReleaseFrame MethodRelease each frame of color data after saving it.
INuiSensor::Release MethodRelease the sensor when you exit the application.

To run a sample you must have the Kinect for Windows SDK installed. To compile a sample, you must have the developer toolkit installed. The latest SDK and developer toolkit are available on the developer download page. If you need help installing the toolkit, look on this page: To Install the SDK and Toolkit. The toolkit includes a sample browser, which you can use to launch a sample or download it to your machine. To open the sample browser, click Start > All Programs > Kinect for Windows SDK [version number] > Developer Toolkit Browser.

If you need help loading a sample in Visual Studio or using Visual Studio to compile, run, or debug, see Opening, Building, and Running Samples in Visual Studio.

Community Additions

© 2015 Microsoft