I am trying to write one portion of my huge C# program that allows me to capture one picture from the integrate camera in the laptop. I have already done my research and i notice that there are 2 ways to do this via WIA and DirectShow. I am trying the easier one : WIA. I am working on a Windows 7 32 bit machine running VS 2010 .Net 4.0 . I am trying to run the following example i found on the web, which is exactly what i want and experienced several errors with regards to it.
http://www.c-sharpcorner.com/uploadfile/yougerthen/610262008064756am/6.aspx
I have added the necessary reference
using System.Windows.Forms;
using Microsoft.Win32;
using WIA;
Majority of the errors are like the following : Interop type 'WIA.CommonDialogClass' cannot be embedded. Use the applicable interface instead. Interop type 'WIA.CommandID' cannot be embedded. Use the applicable interface instead.
Any help provided will be greatly appericiated.
Try this:
Creating COM interfaces with the new operator is allowed. You need to prefix the namespace name because CommonDialog is ambiguous with the Winforms CommonDialog class.