Solved

scanning / twain

Posted on 2000-02-17
11
1,339 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
  • 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
 
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 17

Accepted Solution

by:
inthe earned 100 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Windows Drag & Drop Location 2 94
How to convert wav to mp3 in delphi 9 174
HTML text in the body of an email (delphi code) 12 96
SUM 2 INTEGER ARRAYS INTO 1 10 93
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…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

861 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

23 Experts available now in Live!

Get 1:1 Help Now