internal static byte[] GetPixelArrayFrame(this DepthFrame depthFrame) { var frameData = new ushort[depthFrame.FrameDescription.LengthInPixels]; var pixels = depthFrame.GetNewPixelArray(); depthFrame.CopyToFrameToPixelArray(ref frameData, ref pixels); return(pixels); }