views:

10470

answers:

4

I have found an example for accessing a webcam in C#. The example uses the DirectShow.NET library. I have tried to understand the code, but so far the only thing I could figure out is that somehow the usercontrol calls directshow to draw directly to the surface of the user control.

I want to access each frame and put it into a Bitmap object. How can I tell when a new frame arrived? How can I capture this new frame into a Bitmap Object?

This might be simple to answer if you know your way around DirectShow.NET.

+2  A: 

You will need to use the ISampleGrabber interface there are many c++ examples on the net on how to use it, it will give you data the in RGB raw format which you can feed into the Bitmap class.

There is also an open source called Touchless it has a project in code which takes a web cam and give you a callback every time a new frame arrived.

Shay Erlichmen
Can you tell me where can I get the qedit.h needed for compiling touchless' WebCamLib? I have downloaded both the windows sdk and the directx sdk, but could not find it anywhere.
Richard J. Terrell
Shay Erlichmen
I have installed the August 2007 SDK, but havn't found the qedit.h in the include dir or anywere else.
Richard J. Terrell
My experience on compiling the WebCamLib: you need to download a ~222M file "dx9sdk.exe", its a very old directx 9 sdk (2002), a google search for the filename will help you. After the install in the include dir, you will find the qedit.h. You have to specify this directory in the project properties of WebCamLib. Make sure to compile it in Release, or Vista will cry. Also you might get and error and have to change a POINTER_64 constant to __ptr64.
Richard J. Terrell
Success! Thanks, Touchless was great help :)
Richard J. Terrell
A: 

If you found Touchless useful, but would like to use the latest DirectX SDK, try getting the latest source after change 31008 at http://touchless.codeplex.com/SourceControl/ListDownloadableCommits.aspx

A: 

I have used it for TV box in windows 7 64bit pro where initially it shows nothing but if I ran any tv tuner application like honestechTVR2.5, its starts showing the TV content but the image frames keeps jumping from my application window to honestechTVR2.5 windows. and it looks flickering.

Can any one provide the solution for the same.

Thanks, Divyesh

Divyesh
A: 

please suggest me an application which can be built using touchless sdk...

tamanna vasatkar