本文档为个人博客文档系统的备份版本、作者:小游、作者博客:点击访问
这里只是简单的注释了一下
//------------------------------------------------------------------------------
// <copyright file="MainWindow.xaml.cs" company="Microsoft">
// Copyright (c) Microsoft Corporation. All rights reserved.
// </copyright>
//------------------------------------------------------------------------------
namespace Microsoft.Samples.Kinect.DepthBasics
{
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using Microsoft.Kinect;
/// <summary>
/// Interaction logic for MainWindow
/// </summary>
public partial class MainWindow : Window, INotifyPropertyChanged
{
/// <summary>
/// Map depth range to byte range
/// </summary>
/// map的深度数据
private const int MapDepthToByte = 8000 / 256;
/// <summary>
/// Active Kinect sensor
/// </summary>
/// 传感器
private KinectSensor kinectSensor = null;
/// <summary>
/// Reader for depth frames
/// </summary>
/// 深度框架的
private DepthFrameReader depthFrameReader = null;
/// <summary>
/// Description of the data contained in the depth frame
/// </summary>
/// 色彩深度数据
private FrameDescription depthFrameDescription = null;
/// <summary>
/// Bitmap to display
/// </summary>
/// bitmap对象
private WriteableBitmap depthBitmap = null;
/// <summary>
/// Intermediate storage for frame data converted to color
/// </summary>
/// 深度像素数据
private byte[] depthPixels = null;
/// <summary>
/// Current status text to display
/// </summary>
private string statusText = null;
/// <summary>
/// Initializes a new instance of the MainWindow class.
/// </summary>
public MainWindow()
{
// get the kinectSensor object
//获取传感器
this.kinectSensor = KinectSensor.GetDefault();
// open the reader for the depth frames
//获取深度传感器对象
this.depthFrameReader = this.kinectSensor.DepthFrameSource.OpenReader();
// wire handler for frame arrival
//深度传感器处理函数
this.depthFrameReader.FrameArrived += this.Reader_FrameArrived;
// get FrameDescription from DepthFrameSource
//深度数据