Welcome, in this article I am going to how to get your project setup to use WIA, how successfully connect to an image device and finally how to enumerate all the properties and events the device supports. While this article will only touch the surface of what all you can do with WIA subsequent articles will continue to delve deeper into WIA’s full capabilities.
Shall we get started?
Software & equipment needed
- Windows XP SP1 or later
- Digital camera with WIA drivers
- Microsoft Visual C# 2008 Express Edition
- Windows® Image Acquisition Automation Component
- Yourself (probably the most important)
Getting Setup
Create a new Windows Forms Application and name it whatever you’d like, I named mine WIAIntroduction.
Next add a label, command button and rich textbox control to Form1 (note: I am leaving all controls at their default names for simplicity).
Next we need to add a reference to the WIA library (wiaaut.dll). To this go to the Project->Add Reference menu. In the dialog box select the COM tab and navigate to Microsoft Windows Image Acquisition Library v2.0. If you do not see this make sure that you’ve installed the WIA Automation Component referenced above under Software & equipment needed.
With the reference to the WIA 2.0 library and our form and its controls setup we’re ready to begin communicating with any device with a WIA compliant driver.
Connecting to a Imaging Device with WIA 2.0
Now let’s get to the good stuff and make this application do something other than sit there.
First we need to add a using directive for the WIA library we just added a reference to so that we may begin to access the objects and methods it exposes.
![]()
Next create a private variable of the newly exposed type Device named _device.
Now we need to create a click event handler for button1. The code should look something like this.
Executing the code now and click on the button should produce a dialog box containing on all WIA devices registered on your PC.
Closing thoughts
In this article we learned how to quickly connect to any imaging device using Windows® Image Acquisition Automation Component. In my next article I’ll discuss how to enumerate all the WIA properties and events that a device supports, until then happy coding.
Article source code:
EnumerateWIAProperties.rar






