using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; using Emgu.CV; using Emgu.CV.Structure; using Emgu.Util; namespace Camera_capture2 { public partial class Camera_capture2 : Form { private Capture capture; private bool captureInProgress; public Camera_capture2() { InitializeComponent(); } private void ProcessFrame(object sender, EventArgs arg) { Image<Bgr, Byte> ImageFrame = capture.QueryFrame(); CamImageBox.Image = ImageFrame; } private void button1_Click(object sender, EventArgs e) { #region if capture is not created, create it now if (capture == null) { try { capture = new Capture(); } catch (NullReferenceException excpt) { MessageBox.Show(excpt.Message); } } #endregion if (capture != null) { if (captureInProgress) { btnStart.Text = "Start!"; // Application.Idle -= ProcessFrame; } else { btnStart.Text = "Stop"; Application.Idle += ProcessFrame; } captureInProgress = !captureInProgress; } } private void ReleaseData() { if (capture != null) capture.Dispose();<pre><pre></ } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)