using Emgu.CV; using Emgu.CV.Structure; 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; namespace 照片背景合成 { public partial class Form1 : Form { private Capture cap = null; public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { cap = new Capture(0); Application.Idle += new EventHandler(Application_Idle); } void Application_Idle(object sender, EventArgs e) { Image frame = cap.QueryFrame(); pictureBox1.Image = frame.ToBitmap(); } } }