예제 #1
0
        private void NetworkClient_BodyIndexFrameArrived(object sender, BodyIndexFramePacket e)
        {
            var subscribers = FrameArrived;

            if (subscribers != null)
            {
                Sensor.GetCoordinateMapper().DepthToColor = e.DepthToColorTransform;
                var depthArgs =
                    new BodyIndexFrameArrivedEventArgs(
                        this,
                        e.Bitmap,
                        e.CameraIntrinsics);

                subscribers(this, depthArgs);
            }
        }
        private void BodyIndexReader_FrameArrived(MediaFrameReader sender, MediaFrameArrivedEventArgs args)
        {
            var subscribers = FrameArrived;

            if (subscribers != null)
            {
                var frame = sender.TryAcquireLatestFrame();
                if (frame != null)
                {
                    var bodyIndexArgs =
                        new BodyIndexFrameArrivedEventArgs(
                            this,
                            frame.VideoMediaFrame.SoftwareBitmap,
                            new CameraIntrinsics(frame.VideoMediaFrame.CameraIntrinsics));

                    subscribers(this, bodyIndexArgs);
                }
            }
        }