views:

480

answers:

3

I'm working on online video conferencing project in C# and .Net4.0.

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);

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.

How can i solve this problem . Any type of help will be appreciated.

Thanks srdusad

A: 

If you are comfortable, you can use VLC for this. VLC provides facility to handle webcam.

Ram
Thanks for your reply ! I want to show these grabbed picture in the picture box of diferent forms . If VLC will helpfull , then guide me how to use VLC in my .net code and which dll i have to need for this.
SR Dusad
You can use VLC wrapper created for .NET. You can go to VLC site and also seek help from the VLC developer forum.
Ram
+1  A: 

Hello, 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/

Have fun!

Fredrik Johansson
thanks for giving your views. I downloads the files from above link and the samples run perfectly. But i don't yet able to use this in other form , so i can view same picture in both forms without any dependency.Pls give me any idea that how can i show picture in multi forms using directshow.
SR Dusad
When i change the framework of sample from 2.0 to 4.0 ,it gives me error on sourceFilter = FindCaptureDevice(); pls tell me how to use the direct show sample in .net4.0
SR Dusad
Great to hear that it's working (even if partly)! You should try asking this question in the dedicated DirectShowNet forums at SourceForge, i'm sure the developers are better suited to answer this: http://sourceforge.net/projects/directshownet/forums/forum/460697
Fredrik Johansson
Hi Fedrik : The samples worked correctly upto .Net3.5 but when i change version to .Net4.0 .It gives me error on moniker[0].BindToObject(null, null, ref iid, out source); in public IBaseFilter FindCaptureDevice() function.Pls help me because i want this DirectShownet in .Net4.0
SR Dusad
SR Dusad, there is error in your code as I mentioned on DirectShow.Net forum. Last sample and last DirectShow.Net work fine with any version of .net including .net4 and VS2010.
Konstantin Salavatov
@Konstantin:At my side does all effort,but can't find any success.Pls can send me mail of that sample running on .net4.0 vs2010. my mail id is "[email protected]" . i m waiting for ur mail. Thanks in aadvance
SR Dusad
A: 

Other approach using WIA http://www.codeproject.com/KB/cs/WebCamService.aspx

Konstantin Salavatov