Solved

Scanning images - TWAIN in c#

Posted on 2006-06-28
3
6,460 Views
Last Modified: 2010-07-27
Hi,

Anyone know of a third party component to read images from a scanner using C# - framework 2?

Thanks.
0
Comment
Question by:jasoncpp
  • 2
3 Comments
 
LVL 10

Accepted Solution

by:
dkloeck earned 500 total points
ID: 17000262
Here is a nice project that scans:
http://www.codeproject.com/dotnet/twaindotnet.asp

it explains everything you need
0
 

Expert Comment

by:goopyJava
ID: 24019029
Preface Note
I am a bit new to Experts Exchange so I am not quite sure what it means for a solution to be closed. Keeping that in mind, I shall continue this discussion since my comments seem to pertain closely to the discussion...

Background
I attempted to use the project referred to in the answer with an Epson V100 scanner and found that the though I could get to the initial "preview" scan screen, I couldn't scan any images. Running in debug mode, the reason was obvious looking at the following code segment:

           Marshal.StructureToPtr(winmsg, evtmsg.EventPtr, false);
            evtmsg.Message = 0;
            TwRC rc = DSevent(appid, srcds, TwDG.Control, TwDAT.Event, TwMSG.ProcessEvent, ref evtmsg);
            if (rc == TwRC.NotDSEvent)
            {
                return TwainCommand.Not;
            }

            if (evtmsg.Message == (short)TwMSG.XFerReady)
Basically, the library wants the "transfer ready" message and the "Message" property on the event message structure always comes back 0 ("Null") - meaning the program never initializes the transfer and the scan never happens.

The Question
My question then is, cost aside, where could I find a third party library that allows me to scan multiple images during a single session from TWAIN into a .NET application and if this isn't easy to find, then what might I do to fix the application that answered the original question?
0
 

Expert Comment

by:goopyJava
ID: 24032073
Since I believe this discussion is probably stale I will add just one more comment in reply to my previous comment. After looking around at many different commercial TWAIN interfaces I found here (http://www.devdirect.com/all/IMAGEDIGITAL_PCAT_1927.aspx) I determined that this interface (http://www.vintasoft.com/vstwain-dotnet-index.html) works quite well in .NET. I hope this helps anyone else who has the same issues I had.
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now