<分区>
Possible Duplicate:
Control Camera Device From C#
我有一台笔记本电脑,盖子上有一个内置摄像头。
我想编写一个 C# 应用程序来捕获图像,并将其保存到硬盘。
有没有人有一个快速的代码片段来完成这个?
我在 windows 7(64 位)下运行
<分区>
Possible Duplicate:
Control Camera Device From C#
我有一台笔记本电脑,盖子上有一个内置摄像头。
我想编写一个 C# 应用程序来捕获图像,并将其保存到硬盘。
有没有人有一个快速的代码片段来完成这个?
我在 windows 7(64 位)下运行
最佳答案
Emgu cv 库对此有点矫枉过正,但这里有一个 7 行的示例:
ImageViewer viewer = new ImageViewer(); //create an image viewer
Capture capture = new Capture(); //create a camera captue
Application.Idle += new EventHandler(delegate(object sender, EventArgs e)
{ //run this until application closed (close button click on image viewer)
viewer.Image = capture.QueryFrame(); //draw the image obtained from camera
});
viewer.ShowDialog(); //show the image viewer
(来源:http://emgu.com/wiki/index.php/Camera_Capture_in_7_lines_of_code)
关于c# - 从笔记本电脑相机捕获图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6526682/