private void button1_Click(object sender, System.EventArgs e) { //加载摄像头,并让画面长宽为 pictureBox 的长宽 video = new cVideo(pictureBox1.Handle, pictureBox1.Width, pictureBox1.Height); video.StartWebCam(); }
public void camerDriver_Open() { //加载 try { video = new cVideo(this.pictureBox1.Handle, this.pictureBox1.Width, this.pictureBox1.Height); video.StartWebCam(); } catch (System.Exception ex) { MessageBox.Show(ex.StackTrace + ex.Message); } }