你可以推荐什么库:在.NET摄像头拍摄的图像? [英] What library can you recommend to capture image from a webcam in .Net?
本文介绍了你可以推荐什么库:在.NET摄像头拍摄的图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您可以推荐什么库:在.NET摄像头拍摄的图像?
What library can you recommend to capture image from a webcam in .Net?
推荐答案
Windows图像采集的伎俩用的 wiaCommandTakePicture (VB.NET按你的标签:))
Windows Image Acquisition does the trick with wiaCommandTakePicture (VB.NET as per your tag :) )
在的Coding4Fun 一证明这个项目由Hanselman的>
as demonstrated in this project by Hanselman in coding4fun
我粘贴的C#code,但你可以在网站上阅读也VB.NET的选择:
I pasted the C# code, but you can read the VB.NET alternatives on the site also:
CommonDialogClass class1 = new CommonDialogClass();
Device d = class1.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true,false);
if (d != null)
{
settings.DeviceID = d.DeviceID;
settings.Save();
}
Item item = device.ExecuteCommand(CommandID.wiaCommandTakePicture);
foreach (string format in item.Formats)
{
if (format == jpegGuid)
{
WIA.ImageFile imagefile = item.Transfer(format) as WIA.ImageFile;
filename = GetFreeFileName();
if (string.IsNullOrEmpty(filename) == false)
{
imagefile.SaveFile(filename);
}
this.picLastImage.Load(filename);
return filename;
}
}
这篇关于你可以推荐什么库:在.NET摄像头拍摄的图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文