示例#1
0
        public void LoadSKLRecording(String SKLFile)
        {
            ArrayList SKLRecordingHelp = null;

            try
            {
                SKLRecordingHelp = TSkeletonHelper.ReadRecordingFromFile(SKLFile);
            }
            catch (Exception e)
            {
                String msg = "SKL file " + SKLFile + " loading error: " + e.Message;
                HendlerHolder.DisplayMessage(this, msg);
                return;
            }
            if (SKLRecordingHelp == null)
            {
                String msg = "SKL file " + SKLFile + " seems to be empty.";
                HendlerHolder.DisplayMessage(this, msg);
                return;
            }
            sKLFileName  = SKLFile;
            SKLRecording = SKLRecordingHelp;
            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]);
                 *  }));*/
            }
        }