示例#1
0
        /// <summary>
        /// Sets the VideoCamera's data format. Support function for VideoCamera.DataFormat property.
        /// </summary>
        /// <param name="format">
        /// Format to change the video camera to
        /// </param>
        protected void SetDataFormat(VideoCamera.DataFormatOption format)
        {
            // change imagemap that's waiting cause format has changed
            this.UpdateNextFrameImageMap();

            // change format
            int result = KinectNative.freenect_set_video_format(this.parentDevice.devicePointer, format);

            if (result != 0)
            {
                throw new Exception("Could not switch to video format " + format + ". Error Code: " + result);
            }
            this.dataFormat = format;
        }