Beispiel #1
0
        private void openVideoToolStripMenuItem_Click(object sender, EventArgs e)
        {
            OpenFileDialog openFile = new OpenFileDialog();
            openFile.Title = "Select Video File";
            if (openFile.ShowDialog() != DialogResult.OK)
                return;

            CVCapture cap = new CVCapture(openFile.FileName);
            image = cap.QueryFrame();
            cap.Dispose();

            UpdateHistogram();
        }
Beispiel #2
0
 private static void TestCVCapture()
 {
     CVCapture cap = new CVCapture();
 }
Beispiel #3
0
        private void ReopenCapture()
        {
            if (cap != null) cap.Release();

            if (videoFile == null) cap = new CVCapture();
            else cap = new CVCapture(videoFile);
        }
Beispiel #4
0
        /// <summary>
        /// Opens a video file.
        /// </summary>
        /// <param name="path"></param>
        public void Open(string path)
        {
            CVCapture newCapture = new CVCapture(path);

            if (Opening != null)
            {
                OpeningEventArgs oea = new OpeningEventArgs();
                oea.CurrentCapture = capture;
                oea.NewCapture = newCapture;
                oea.Cancel = false;
                Opening(this, oea);

                if (oea.Cancel)
                {
                    newCapture.Dispose();
                    return;
                }
            }

            videoTimer.Enabled = false;
            capture = newCapture;
            videoTimer.Interval = 1000 / capture.FramesPerSecond;
        }