19

I know that you can use WIA from .net ecosystem without (too) much hassle, but I've found using WIA this way, well, at least erratic. I've seen my code behave perfectly to not working at all to some WIA features not working and refusing to play at all, let alone nice.

You can read about it in my WIA 2.0 HP ScanJet 7650 specific problems question which didn't get a single comment, let alone answer in six months.

So, I'm willing to buy WIA .NET component that works, for a reasonable amount of money - reasonable being up to $300. I've been browsing aroung ComponentSorce and there are many $2000 brontosaurses that do TWAIN and eat small children if not treated nice, but not a single WIA .NET component.

Oh yeah, and a little rant - MSDN's documentation and examples on WIA are really really substandard.

UPDATE - To all who think that this problem can be solved with reading proof-of-concept and look-it-works articles with sample code on WIA - it cannot. To get from look-it-works to reliable scanning support for many devices is a lot of work. I've tested three different scanners on my computer using WIA from .net, and just when you think you've got some detail figured out, you plug in another scanner and see that you haven't figured out anything. That is why I'm willing to pay for this.

4
  • Your question is drawing too little views, maybe if you change the title to something else? SOLID SCANNER component for example? Maybe people doesn't use WIA at all... May 13, 2011 at 12:47
  • Sorry that this issue with WIA 2.0 and ,net has been a frustrating one. Judging by the lack of response, there's probably no stand-out component of this sort. BTW, Googling around does uncover some WIA capable choices - but haven't found one at the $300 price point tho'. Good luck
    – rskar
    May 18, 2011 at 12:50
  • From what I can tell, calling support for scanners in .net a joke is being generous. I'm in the same boat as you. All the links ppl provide on this page are purple for me (not blue), because I've already looked at them all before finding this post. I still haven't found a way to reliably set page size or any other WIA property... /givingup Jun 13, 2013 at 6:59
  • "there are many $2000 brontosaurses that do TWAIN and eat small children if not treated nice" LOL :-)
    – Max
    Sep 28, 2016 at 12:20

4 Answers 4

2

Have you seen this article? http://10rem.net/blog/2010/01/08/scanning-images-in-wpf-via-wia

The above project can be downloaded from: http://10rem.net/media/55896/petebrownwpfscannerdemo.zip

It's in C#, so it may be of help.

2

You probably want to check if the device supports WPD, the replacement of WIA in Vista or later. If the device does not support WPD, then try access the device with WIA Automation Layer. It can't handle WIA device-specific problems for sure, but at least it is good for standardized behavior. If neither WPD nor WIA is supported, I am afraid you have to deal with the old TWAIN interface.

The WIA documentation in Windows Driver Kit is on par with the documentation in Windows SDK. Don't be surprised if a driver developer fails to follow the WIA driver guidelines. If you travel WIA scanner trees, make sure you are aware of the difference of tree layout for Windows XP, Vista and Windows 7.

There is a discussion about wrappers of these APIs for .Net applications at .NET Scanning API.

0

I would save the money and recommend reading an article like this one: http://www.codeproject.com/KB/cs/WebCamService.aspx

Follow the steps, and adapt the code to meet your requirements.

0

I commented on the question, but I figured I'd add to this collection of links with something new I just came across: https://github.com/baffles/derp-scan

It looks like it might be the beginnings of a WIA library that might actually be usable (some day).

From looking at the code, the problem might be some properties only work as device properties and some only work as item properties (WIA_DPS_* vs WIA_IPS_*): http://msdn.microsoft.com/en-us/library/windows/hardware/ff539542(v=vs.85).aspx

It mentions there that there is overlap between the two and I'm guessing no two scanners behave the same way... does this mean you should just set them both? I don't know. I'm with you, the docs are shite.

TL;DR; Copying code from codeproject isn't going to help this time.

3
  • 1
    I'm the owner of that github repo (derp-scan). It probably won't become much, unfortunately. I don't have any motivation to work on it anymore, since the drivers for my scanner are crippled in such a way that only the software they ship seems to be useful. :(
    – BAF
    Mar 25, 2014 at 16:48
  • I understand. I've basically done the same... Use crappy scanner software to scan to pdf or image and parse that. Kinda crazy. Jul 5, 2014 at 2:09
  • 1
    Not sure why I've been down voted here. The answer to this question is it doesn't have an answer and it has become a repository of knowledge. Deal with it. Jan 2, 2018 at 16:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.