using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using PickHead; namespace VideoTest { public partial class Form2 : Form { public Form2() { InitializeComponent(); } VideoClass wc; private void Form2_Load(object sender, EventArgs e) { button1.Enabled = false; button2.Enabled = true; panelPreview.Size = new Size(330, 330); wc = new VideoClass(panelPreview.Handle,panelPreview.Left,panelPreview.Top, panelPreview.Width, panelPreview.Height); wc.Start(); } private void button1_Click(object sender, EventArgs e) { button1.Enabled = false; button2.Enabled = true; panelPreview.Size = new Size(330, 330); wc = new VideoClass(panelPreview.Handle,panelPreview.Left,panelPreview.Top, panelPreview.Width, panelPreview.Height); wc.Start(); } private void button2_Click(object sender, EventArgs e) { button1.Enabled = true; button2.Enabled = false; wc.Stop(); } private void button3_Click(object sender, EventArgs e) { button3.Enabled = false; wc.GrabImage("c://aaaa.jpg"); button3.Enabled = true; } private void button4_Click(object sender, EventArgs e) { button4.Enabled = false; button5.Enabled = true; wc.Kinescope("C://aa.avi"); button4.Enabled = true; button5.Enabled = false; } private void button5_Click(object sender, EventArgs e) { button5.Enabled = false; button4.Enabled = true; wc.StopKinescope(); button5.Enabled = true; button4.Enabled = false; } } }