如何获得网络摄像头的图像在C#中? [英] How to get web cam images in C#?
问题描述
我的工作在C#和.Net4.0在线视频会议项目。
I'm working on online video conferencing project in C# and .Net4.0.
我希望有一个图书馆或code,我可以使用不同的形式收集网络摄像机的图像每秒。我试试这个使用AVICAP32,在此我们在这个发送的邮件像复制或编辑frames.but不同的目的,我们要通过图片框的参考,同时创造处理程序,如下所示:
I want a library or code which I can use for collecting web camera images per second in different form. I try this by using the AVICAP32, in which we send Messages for different purpose like copy or edit frames.but in this we have to pass a reference of picturebox while creating handler as given below:
mCapHwnd = capCreateCaptureWindowA("0", 268435456 | 1073741824, 0, 0, 640, 480,picturebox1.Handle.ToInt32(), 0);
使用这些命令,我能够捕捉到的图像,但问题是当我尽量减少PictureBox的形式。当时并没有创造新的形象。
Using these commands I'm able to capture images but the problem comes when I minimize the picturebox form. At that time doesn't create new image.
我觉得这事是因为我最小化的形式,当它直接复制此剪贴板中的图像不显示任何东西。
I think this is happened because I minimize the form and when it copies the image from this clipboard it doesn't show anything.
我怎样才能解决这个问题。任何形式的帮助将AP preciated。
How can i solve this problem . Any type of help will be appreciated.
谢谢 srdusad
Thanks srdusad
推荐答案
我使用所有提到的技术(; DirectShow的WIA,AviCap&AMP)做到了这一点。 DirectShow是您最佳的选择。退房的免费DirectShowNet库,它是一个.NET包装DirectShow的,甚至包括样品: http://directshownet.sourceforge.net/
I've done this using all the mentioned techniques (WIA, AviCap & DirectShow). DirectShow is your best option. Check out the free DirectShowNet library which is a .NET wrapper for DirectShow, it even includes samples: http://directshownet.sourceforge.net/
更新2012-07-26:我刚刚发布了我的Windows应用程序CamTimer的完整源$ C $ C(.NET编写/ C#)。下载/查看完整的code(带摄像头的工作示例)在<一个href="https://github.com/johanssonrobotics/CamTimer">https://github.com/johanssonrobotics/CamTimer
UPDATE 2012-07-26: I've just released the complete sourcecode of my Windows app CamTimer (written in .NET/C#). Download/view the complete code (with working Webcam examples) at https://github.com/johanssonrobotics/CamTimer
这篇关于如何获得网络摄像头的图像在C#中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!