Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

scanning / twain

Posted on 2000-02-17
11
Medium Priority
?
1,379 Views
Last Modified: 2008-02-26
Hello experts,

For this project I'm working on, I'll have to be able to 'handle' scanned documents, from various types of scanners.

there are some choice's to make:
- have Delphi accept scanned formats from various scanners.
- have a converter to convert multiple formats to one format Delphi uses.

I'm still disigning this part of the system, but also doing some research in advance. I did search on the net for avaiblable Delphi components and the TWAIN initiative and will continue doing this.

My question: Could somebody advise me in this scenario? Did people make applications that support a variety of scanners? Are there known problems?

If more people have 'answers', I can do something with points.

I was also thinking about 'Imaging', can I use this as by COM / OLE within my form? Should I automate this program, or get Delphi components?

Next to this I also want a thumbnail like view in Delphi... ...and by the by, I need to be able to handle:
1 scan; 1 page.
1 scan; multiple pages.
'1 scan'; multiple scans, multiple pages.

thanks,
Floris.

0
Comment
Question by:florisb
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 3
  • 2
  • +1
11 Comments
 
LVL 5

Expert Comment

by:TheNeil
ID: 2530606
The neat thing about TWAIN is, is that it does all the handling for you. What you need to do is connect to it. The component that I've used in the past (and I'm not saying that it's the best but it diod exactly what I needed) was SkyLine's ImageLib

http://skylinetools.com/imagelib/index.html

The Neil
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 2530621
TWAIN

you can have a look at

ftp://delphi-jedi.org//api/twain.zip

(or all the other Twain components on Torry)

THUMBNAILS

http://torry.rimini.com/vcl/graphics/cst_g.zip (FW)
http://torry.rimini.com/vcl/graphics/thumbs.zip (FWS)
0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2530670
Try taking a look at

torry.spang.org/vcl/graphics/enlib.zip

It claims to do TWAIN support.

To expand on what I said earlier, TWAIN is just a standard way for scanners to connect. All the manufacturer has to do is make sure that his scanner complies with the standards set and then ANYTHING can connect to it. You don't have to worry about the specifics of the hardware as the interface supplied by the manufacturer deals with all that for you. Therefore your application just has to use TWAIN and it can connect to any scanner that is TWAIN compliant.

As for scanning multiple pages, multiple scans etc. then it all depends what the manufacturer builds into his interface.

The ImageLib components come with a dialog that allows you to change the current scanner if more than one is installed and I'm fairly certain that this is actually a standard TWAIN feature rather than something specific to just ImageLib, so that poses no problems.

Hope this makes things a little clearer

The Neil
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 2

Author Comment

by:florisb
ID: 2530786
thanks Neil en ZifNab, I'm checking the webpages and downloading demo's.

Do you also perhaps have experience making Delphi applications that Use scanned images? Common errors and stuff?
And storing scans in databases?

Floris.





0
 
LVL 5

Expert Comment

by:TheNeil
ID: 2530823
Floris,

I did develop a couple of TWAIN applications a few years ago and can't remember having any headaches. Once you've scanned your image in it's simple an image and you can treat it like any other - put it into a database, save it, jump up and down on it, whatever.

The components that I used were pretty good when it came to errors and problems and as I recall I just got a flag back indicating if the scanner was available, if the scan was cencelled etc. There wasn't any nasty errors or exceptions flying about and it was painless to code.

One thing that I did notice/find useful was some code to crop the image once it's scanned in. This isn't really a TWAIN problem and your drivers might even do the job for you.

Hope this helps

The Neil
0
 
LVL 17

Accepted Solution

by:
inthe earned 300 total points
ID: 2533948
hi,

Pasted from the paqs:

<start>

I am using the eztw32.dll. It is very easy to use.
You just need this DLL in the directory of your
application. I downloaded this DLL some time ago from
the official TWAIN site www.twain.org, but I cannot find
it any longer there. Using Altavista I found another
 place:
http://www.i-rose.si/mare/programing/index.html.
 He provides also a Delphi interface. But you may also
  use mine:

function TWAIN_IsAvailable: integer; stdcall;
  external 'Eztw32.dll' index 26;

function TWAIN_SelectImageSource(Handle: hWnd): integer; stdcall;
  external 'Eztw32.dll' index 38;

function TWAIN_AcquireNative(Handle: hWnd;
  wPixTypes: integer): integer; stdcall;
  external 'Eztw32.dll' index 2;

function TWAIN_WriteNativeToFilename(Handle: THandle;
  FileName: pChar): integer; stdcall;
  external 'Eztw32.dll' index 49;

To scan an image and save it to a BMP file:

  Handle := TWAIN_AcquireNative(0, 0);
  if Handle > 0 then
  begin
    Result := TWAIN_WriteNativeToFileName(Handle, pChar(FileName)) = 0;
    GlobalFree(Handle);
  end;

Its really simple and unlike other interfaces AcquireNative only returns when the document is scanned.
<end>

just some more meat for the soup ;-)
0
 
LVL 2

Author Comment

by:florisb
ID: 2534131
Thanks Inthe, just downloaded, trying now.

I'll leave this message open for the weekend...

After that the points, perhaps with a trick to divide them...

Greetings,
Floris.

0
 
LVL 2

Author Comment

by:florisb
ID: 2534552
Research area's defined:
·      Image formats.
·      Scanners.
·      Twain drivers.
·      Images edit & display controls.
·      OCR.

How about that? Just collected 1001 internet links and demo's. Now for real.

Floris.

0
 
LVL 2

Author Comment

by:florisb
ID: 2541582
Hi inthe,

I'm going to try your lib. One more question: is that library a good one to use for a 'professional application'?

For the edit controls I'l try the one Neil adviced (ImageLib).

C.U.
Floris.
0
 
LVL 17

Expert Comment

by:inthe
ID: 2543620
hi floris,
thats a bit of an odd question, as code for a free program would be identical to code for a expensive proffesional application wouldnt it ?

for an answer, well im sure it'll be just fine ;-)

0
 
LVL 2

Author Comment

by:florisb
ID: 2545221
Hi inthe,

Tried eztw32.dll yesterday, workerd perfect. With my odd question, I was aksing something like: how much functionality does that lib offer? Okee, I know now.

By the by, you know the standard Windows imaging (it's from Microsoft, Wang and Eastman Software; see also www.eastmansoftware.com), it has controls (activex / ocx) you can import in Delphi, and is TWAIN compatible, see it's help after importing in Delphi. It works, but a bit buggy with the 1.1 version (3 years old)... ...hope I'll upgrade today.

Decided to give you the points Inthe. Neil, you should get something like 30% of the points; maybe more, it's just that I really used InThe's comment for a demo... ...your imgaLib link will probably be usefull later. I heard people on E.E. compaining about people not giving points, so I decided I will not wait with that too long.

PLEASE DO CHECK MY TO OTHER TWAIN / ISIS / IMAGING related questions:
http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10297422 
and
http://www.experts-exchange.com/jsp/qShow.jsp?ta=delphi&qid=10298519 

ZifNab... ...thanks too for commenting! It's in my document.

Floris.



0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

715 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