Exemple #1
0
        public void _replay_BodyFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayBodyFrame> e)
        {
            if (!_isSkeletonEnabled)
            {
                return;
            }

            if (!ReferenceEquals(null, e.Frame))
            {
                float _width  = 512;
                float _height = 424;

                Color color;
                var   bitmap = BitmapFactory.New((int)_width, (int)_height);
                foreach (var body in e.Frame.Bodies)
                {
                    if (body.IsTracked)
                    {
                        color = Colors.Blue;
                        body.AddToBitmap(bitmap, color, color);
                    }
                }
                OnSkeletonImageArrived(bitmap);
            }
        }
 void _replay_BodyFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayBodyFrame> e)
 {
     if (_displayType == FrameTypes.Body)
     {
         OutputImage.Source = e.Frame.Bodies.GetBitmap(Colors.LightGreen, Colors.Yellow);
     }
 }
Exemple #3
0
        //private void _replay_BodyFrameArrived(object sender, ReplayFrameArrivedEventArgs<ReplayBodyFrame> e)
        //{
        //    if (!bodyFrameEnable || !viewEnable) return;
        //    MainWindow.Instance().bodyImageControl.Source = e.Frame.Bodies.GetBitmap(Colors.LightGreen, Colors.Yellow);
        //}

        private void _replay_BodyFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayBodyFrame> e)
        {
            if (!bodyFrameEnable || !viewEnable || Scene.Instance == null)
            {
                return;
            }

            float _width  = 512;
            float _height = 424;

            Color color;
            var   bitmap = BitmapFactory.New((int)_width, (int)_height);

            //using (var context = bitmap.GetBitmapContext())
            //{
            foreach (var body in e.Frame.Bodies)
            {
                if (body.IsTracked)
                {
                    Person person = Scene.Instance.Persons.FirstOrDefault(p => p.TrackingId == (long)body.TrackingId);
                    color = (person.Color as SolidColorBrush).Color;
                    body.AddToBitmap(bitmap, color, color);
                }
            }
            MainWindow.Instance().bodyImageControl.Source = bitmap; // e.Frame.Bodies.GetBitmap(Colors.LightGreen, Colors.Yellow);
        }
 void _replay_InfraredFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayInfraredFrame> e)
 {
     if (_displayType == FrameTypes.Infrared)
     {
         if (_infraredBitmap == null)
         {
             _infraredBitmap    = new InfraredFrameBitmap(e.Frame.Width, e.Frame.Height);
             OutputImage.Source = _infraredBitmap.Bitmap;
         }
         _infraredBitmap.Update(e.Frame);
     }
 }
 void _replay_DepthFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayDepthFrame> e)
 {
     if (_displayType == FrameTypes.Depth)
     {
         if (_depthBitmap == null)
         {
             _depthBitmap       = new DepthFrameBitmap(e.Frame.Width, e.Frame.Height);
             OutputImage.Source = _depthBitmap.Bitmap;
         }
         _depthBitmap.Update(e.Frame);
     }
 }
 void _replay_ColorFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayColorFrame> e)
 {
     if (_displayType == FrameTypes.Color)
     {
         if (_colorBitmap == null)
         {
             _colorBitmap       = new ColorFrameBitmap(e.Frame);
             OutputImage.Source = _colorBitmap.Bitmap;
         }
         _colorBitmap.Update(e.Frame);
     }
 }
Exemple #7
0
        public void _replay_ColorFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayColorFrame> e)
        {
            if (!_isColorEnabled)
            {
                return;
            }

            if (!ReferenceEquals(null, e.Frame))
            {
                _colorBitmap.Update(e.Frame);
                OnColorImageArrived(_colorBitmap.Bitmap);
            }
        }
Exemple #8
0
 private void _replay_ColorFrameArrived(object sender, ReplayFrameArrivedEventArgs <ReplayColorFrame> e)
 {
     if (!colorFrameEnable || !viewEnable)
     {
         return;
     }
     if (_colorBitmap == null)
     {
         _colorBitmap = new ColorFrameBitmap(e.Frame);
         MainWindow.Instance().colorImageControl.Source = _colorBitmap.Bitmap;
         //_justColorFrameEnabled = false;
     }
     _colorBitmap.Update(e.Frame);
 }
Exemple #9
0
 void _replay_InfraredFrameArrived(object sender, ReplayFrameArrivedEventArgs<ReplayInfraredFrame> e)
 {
     if (_displayType == FrameTypes.Infrared)
     {
         if (_infraredBitmap == null)
         {
             _infraredBitmap = new InfraredFrameBitmap(e.Frame.Width, e.Frame.Height);
             OutputImage.Source = _infraredBitmap.Bitmap;
         }
         _infraredBitmap.Update(e.Frame);
     }
 }
Exemple #10
0
 void _replay_DepthFrameArrived(object sender, ReplayFrameArrivedEventArgs<ReplayDepthFrame> e)
 {
     if (_displayType == FrameTypes.Depth)
     {
         if (_depthBitmap == null)
         {
             _depthBitmap = new DepthFrameBitmap(e.Frame.Width, e.Frame.Height);
             OutputImage.Source = _depthBitmap.Bitmap;
         }
         _depthBitmap.Update(e.Frame);
     }
 }
Exemple #11
0
 void _replay_ColorFrameArrived(object sender, ReplayFrameArrivedEventArgs<ReplayColorFrame> e)
 {
     if (_displayType == FrameTypes.Color)
     {
         if (_colorBitmap == null)
         {
             _colorBitmap = new ColorFrameBitmap(e.Frame);
             OutputImage.Source = _colorBitmap.Bitmap;
         }
         _colorBitmap.Update(e.Frame);
     }
 }
Exemple #12
0
 void _replay_BodyFrameArrived(object sender, ReplayFrameArrivedEventArgs<ReplayBodyFrame> e)
 {
     if (_displayType == FrameTypes.Body)
     {
         OutputImage.Source = e.Frame.Bodies.GetBitmap(Colors.LightGreen, Colors.Yellow);
     }
 }