예제 #1
0
 public void StopCapture()
 {
     recording = false;
     if (sKLFileStream == null)
     {
         return;
     }
     CaptureStopwatch.Stop();
     if (sKLFileStream != null)
     {
         sKLFileStream.Close();
     }
     sKLFileStream = null;
     if (SKLRecording != null)
     {
         SKLRecording.Clear();
     }
     HendlerHolder.OpenNewPlayerWindow(true, SKLFileName);
     SKLFileName = null;
     ChangeContentWhileRecordingOrPlaying(false);
     SKLRecording = TSkeletonHelper.ReadRecordingFromFile(SKLFileName);
     LoadSKLRecording(SKLFileName);
     ChangeContentWhileRecordingOrPlaying(false);
     if (SKLRecording != null)
     {
         ProgressSlider.Maximum = SKLRecording.Count - 1;
         ProgressSlider.Value   = ProgressSlider.Maximum;
         ProgressSlider.Value   = 0;
         if (SKLRecording.Count > 0)
         {
             DrawImage((TSkeleton[])SKLRecording[0]);
         }
     }
     else
     {
         ProgressSlider.Maximum = 0;
         ProgressSlider.Value   = 0;
         DrawImage(null);
     }
 }
예제 #2
0
        private void SkeletonOutput_Drop(object sender, DragEventArgs e)
        {
            if (IsPlaying == true || recording == true || HendlerHolder.FileDroppingEnabled == false)
            {
                string msg = "File dropping has been disabled either by internal processing (like recording or playing) or by the user in main menu.";
                HendlerHolder.DisplayMessage(this, msg);
                return;
            }
            if (e.Data.GetDataPresent(DataFormats.FileDrop))
            {
                // Note that you can have more than one file.
                string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
                for (int a = 0; a < files.Length; a++)
                {
                    if (System.IO.Path.GetExtension(files[a]).ToLower() == ".skl")
                    {
                        if (HendlerHolder.IsKinectPlayerWindow(this))
                        {
                            HendlerHolder.OpenNewPlayerWindow(true, files[a]);
                        }
                        else
                        {
                            LoadSKLRecording(files[0]);
                            Title = files[0];
                        }
                    }
                }
                // Assuming you have one file that you care about, pass it off to whatever
                // handling code you have defined.

                /*Dispatcher.Invoke(
                 *  new Action(
                 *  () =>
                 *  {
                 *      this.parentMainWindow.LoadSkeletonFile(files[0]);
                 *  }));*/
            }
        }