Search code examples
c#.netwebcam

Is there an easy way to access the webcam from C#?


How can I access the webcam easily with VS2010 and C#?

I tried to copy the avicap21.dll, but VS2010 can't import the library.


Solution

  • This is a native DLL. not a COM object so VS will not import it for you. You need to write your own "header" translation or find something on the web:

    (this is a translation for a later version) http://www.c-sharpcorner.com/UploadFile/yougerthen/810262008070218AM/8.aspx

    Also you should consider using DirectShow which is a more .NET friendly way to access WebCams.

    E.