// abc.ShowDisplayDialog();
           //// abc.Initialize( 1,324,257);
           // //abc.PreviewMode();
           // abc.ShowFormatDialog();            VideoWork wv = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
            wv.Start();
        }        private void Form1_Resize(object sender, EventArgs e)
        {
            VideoWork wv1 = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
            
            wv1.Start();
        }        private void 停止ToolStripMenuItem1_Click(object sender, EventArgs e)
        {
            VideoWork wv = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
          
            wv.Stop();
        }        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            Form1.ActiveForm.Close();
        }        private void panel1_Paint(object sender, PaintEventArgs e)
        {        }      }
}

解决方案 »

  1.   

    using System;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Text;
    using System.Windows.Forms;
    using System.Runtime.InteropServices; 
    namespace USBVideo
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }        private void Form1_Load(object sender, EventArgs e)
            {
                
                //this.WindowState = FormWindowState.Maximized;
                VideoWork wv = new VideoWork(panel1.Handle, 0, 1, panel1.Width, panel1.Height);
                wv.Start();
            }        private void button1_Click(object sender, EventArgs e)
            {
               // VedioCapture abc = new VedioCapture();
               // abc.ShowDisplayDialog();
               //// abc.Initialize( 1,324,257);
               // //abc.PreviewMode();
               // abc.ShowFormatDialog();            VideoWork wv = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
                wv.Start();
            }        private void Form1_Resize(object sender, EventArgs e)
            {
                VideoWork wv1 = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
                
                wv1.Start();
            }        private void 停止ToolStripMenuItem1_Click(object sender, EventArgs e)
            {
                VideoWork wv = new VideoWork(panel1.Handle, 0, 0, panel1.Width, panel1.Height);
              
                wv.Stop();
            }        private void 退出ToolStripMenuItem_Click(object sender, EventArgs e)
            {
                Form1.ActiveForm.Close();
            }        private void panel1_Paint(object sender, PaintEventArgs e)
            {        }      }
    }