コード例 #1
0
ファイル: VideoWindow.xaml.cs プロジェクト: fabianhick/viana
        /// <summary>
        ///   Initializes a new instance of the <see cref="VideoWindow" /> class.
        /// </summary>
        public VideoWindow()
        {
            this.CoordinateSystem = Activator.CreateInstance <CoordinateSystem>();
            this.InitializeComponent();
            this.SetVideoMode(VideoMode.File);
            this.CreateCrossHairLines();
            this.timesliderUpdateTimer = new DispatcherTimer {
                Interval = TimeSpan.FromMilliseconds(200)
            };
            this.timesliderUpdateTimer.Tick += this.TimesliderUpdateTimerTick;

            // this.thresholdEffect = new ThresholdEffect();
            RenderOptions.SetBitmapScalingMode(this.VideoImage, BitmapScalingMode.LowQuality);

            Viana.Project.CalibrationData.PropertyChanged += this.CalibrationPropertyChanged;

            Video.Instance.VideoFrameChanged += this.OnVideoFrameChanged;

            Video.Instance.VideoPlayerElement.StepComplete += this.VideoPlayerElementStepComplete;
            Video.Instance.VideoPlayerElement.FileComplete += this.VideoPlayerElementFileComplete;

            Viana.Project.ProcessingData.PropertyChanged += this.ProcessingDataPropertyChanged;
            Viana.Project.ProcessingData.FrameProcessed  += this.ProcessingDataFrameProcessed;
            this.TimelineSlider.SelectionEndReached      += this.TimelineSliderSelectionEndReached;
            this.TimelineSlider.SelectionAndValueChanged += this.TimelineSliderSelectionAndValueChanged;
            Video.Instance.OriginalImageSource            = Viana.GetImageSource("NoVideo800600.png");
        }
コード例 #2
0
ファイル: VideoWindow.xaml.cs プロジェクト: fabianhick/viana
 /// <summary>
 /// The btn stop_ click.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void BtnStopClick(object sender, RoutedEventArgs e)
 {
     Video.Instance.Revert();
     this.TimelineSlider.Value = this.TimelineSlider.SelectionStart;
     this.isPlaying            = false;
     this.BtnPlayImage.Source  = Viana.GetImageSource("Start16.png");
 }
コード例 #3
0
ファイル: VideoWindow.xaml.cs プロジェクト: fabianhick/viana
        /// <summary>
        /// The btn start_ click.
        /// </summary>
        /// <param name="sender">
        /// The sender.
        /// </param>
        /// <param name="e">
        /// The e.
        /// </param>
        private void BtnPlayClick(object sender, RoutedEventArgs e)
        {
            if (this.isPlaying)
            {
                this.BtnPlayImage.Source = Viana.GetImageSource("Start16.png");
                Video.Instance.Pause();
            }
            else
            {
                this.BtnPlayImage.Source = Viana.GetImageSource("Pause16.png");
                Video.Instance.Play();
            }

            this.isPlaying = !this.isPlaying;
        }
コード例 #4
0
ファイル: VideoWindow.xaml.cs プロジェクト: fabianhick/viana
 /// <summary>
 /// The timeline slider_ selection end reached.
 /// </summary>
 /// <param name="sender">
 /// The sender.
 /// </param>
 /// <param name="e">
 /// The e.
 /// </param>
 private void TimelineSliderSelectionEndReached(object sender, EventArgs e)
 {
     Video.Instance.Pause();
     this.BtnPlayImage.Source = Viana.GetImageSource("Start16.png");
     this.isPlaying           = false;
 }