void Sensor_DepthFrameReady(object sender, DepthImageFrameReadyEventArgs e)
{
using (var image = e.OpenDepthImageFrame())
{
if (image != null)
{
if (this.data == null)
{
this.data = new short[image.PixelDataLength];
}
image.CopyPixelDataTo(this.data);
this.ConvertData(this.data);
this.writeableBitmap.WritePixels(new Int32Rect(0, 0, image.Width, image.Height), this.depthFrame32, image.Width * 4, 0);
this.OnNewDataAvailable();
}
}
}