コード例 #1
0
        /// <summary>
        /// Captures the specified Kinect infrared frame and saves it to the specified location.
        /// </summary>
        /// <param name="frame">The infrared frame to capture.</param>
        /// <param name="path">The desired file path, including file name and extension, for the new image. Currently, JPEG, PNG and BMP formats are supported.</param>
        /// <returns>True if the bitmap file was successfully saved. False otherwise.</returns>
        public static bool Capture(this InfraredFrame frame, string path)
        {
            if (frame == null)
            {
                return(false);
            }

            return(Capture(frame.ToBitmap(), path));
        }
コード例 #2
0
        /// <summary>
        /// Captures the specified Kinect infrared frame and saves it to the specified location.
        /// </summary>
        /// <param name="frame">The infrared frame to capture.</param>
        /// <param name="file">The storage file for the new image. JPEG, PNG, GIF, BMP and TIFF formats are supported.</param>
        /// <param name="width">The width of the image file.</param>
        /// <param name="height">The height of the image file.</param>
        /// <returns>True if the bitmap file was successfully saved. False otherwise.</returns>
        public static async Task <bool> Capture(this InfraredFrame frame, StorageFile file, int width, int height)
        {
            if (frame == null)
            {
                return(false);
            }

            return(await Capture(frame.ToBitmap(), file, width, height));
        }
コード例 #3
0
 /// <summary>
 /// Acquires the latest infrared frame.
 /// It calles the OnInfraredFrameReceived only if the acquired frame is not null.
 /// </summary>
 protected void UpdateInfraredFrame(bool updateFrameView = true)
 {
     if (infraredFrameReader != null)
     {
         using (InfraredFrame frame = infraredFrameReader.AcquireLatestFrame())
         {
             if (frame != null)
             {
                 if (updateFrameView)
                 {
                     frameView.FrameTexture = frame.ToBitmap();
                 }
                 OnInfraredFrameReceived(frame);
             }
         }
     }
 }
コード例 #4
0
        /// <summary>
        /// Converts the specified infrared frame to a bitmap and saves it to the specified location.
        /// </summary>
        /// <param name="source">The source infrared frame.</param>
        /// <param name="destination">The destination path for the new image. JPEG, PNG, GIF, BMP and TIFF formats are supported.</param>
        /// <returns>True if the frame was successfully saved. False otherwise.</returns>
        public static bool Save(this InfraredFrame frame, string path)
        {
            var bitmap = frame.ToBitmap();

            return(_capture.Save(bitmap, path));
        }
コード例 #5
0
        /// <summary>
        /// Converts the specified infrared frame to a bitmap and saves it to the specified location.
        /// </summary>
        /// <param name="frame">The source infrared frame.</param>
        /// <param name="destination">The destination storage file for the image. JPEG, PNG, GIF, BMP and TIFF formats are supported.</param>
        /// <param name="width">The width of the image file.</param>
        /// <param name="height">The height of the image file.</param>
        /// <returns>True if the frame was successfully saved. False otherwise.</returns>
        public static async Task <bool> Save(this InfraredFrame frame, StorageFile destination, int width, int height)
        {
            var bitmap = frame.ToBitmap();

            return(await _capture.Save(bitmap, destination, width, height));
        }
コード例 #6
0
        /// <summary>
        /// Converts the specified infrared frame to a bitmap and saves it to the specified location.
        /// </summary>
        /// <param name="source">The source infrared frame.</param>
        /// <param name="destination">The destination path for the image. JPEG, PNG, GIF, BMP and TIFF formats are supported.</param>
        /// <param name="width">The width of the image file.</param>
        /// <param name="height">The height of the image file.</param>
        /// <returns>True if the frame was successfully saved. False otherwise.</returns>
        public static async Task <bool> Save(this InfraredFrame frame, string path, int width, int height)
        {
            var bitmap = frame.ToBitmap();

            return(await _capture.Save(bitmap, path, width, height));
        }