http://blog.csdn.net/halen0820/article/details/6897147
對於視頻編程,網絡上的東西不是很好找,攝像頭算是比較初級的東東了,我查了很多資料,才算是有一點結果,現在把攝像頭采集程序代碼與大家分享一下。(vs2008編譯通過)
其中,Aforge.net下載地址http://www.aforgenet.com/framework/
下載lib之後,引用就可以了
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using AForge.Video;
using AForge.Video.DirectShow;
namespace 視頻
{
publicpartial class Form1 : Form
{
private bool DeviceExist = false;
private FilterInfoCollection videoDevices;
private VideoCaptureDevice videoSource = null;
private Timer timer1 = new Timer();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
getCamList();
}
private voidgetCamList()
{
try
{
videoDevices = newFilterInfoCollection(FilterCategory.VideoInputDevice);
comboBox1.Items.Clear();
if (videoDevices.Count ==0)
throw newApplicationException();
DeviceExist =true;