Windows Image Acquisition via Silverlight

Yesterday I wrote a blog post about the possibilities & problems around hardware integration from Silverlight using the sockets capabilities. This evening whilst I was watching some television I started playing with this idea.

In the end I created a simple HttpListener (in a console application) which listens on port 8888 which serves up the client access policy file. In a subsequent WebClient request from the Silverlight application a call the the Windows Image Acquisition (WIA) API is used to grab an image and transfer it into the Silverlight application.

You can download my demo code over at MSDN. The reason I’ve been playing with this stuff is that I’d like to deliver a web-based Point-of-Sale experience but there are some requirements for hardware integration at particular workstations.

With a little bit more work I think it might be possible to come up with a really elegant solution that works across multiple sites. So if you were building a Silverlight application and you wanted to support some image capture you could just launch a hyperlink to a ClickOnce application (from a trusted source) which would download a small footprint HTTP server which would provide the client-side integration.

One of the key requirements would be security so you could set it up so that each time an application requested a scan it could pop up and approval dialog for that domain. That would then tweak the access policy file that it dished up and Silverlight would then make the actual request to scan the image.

One thought on “Windows Image Acquisition via Silverlight

  1. Jorge Solano

    Hi, nice article I googling for this, just solution mark me this error,The imported project c:\ProgramFiles\MSBuild\CSharp.targets was not foud. confirm the path in the declaration is correct.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s