Solved

scanning / twain

Posted on 2000-02-17
11
1,329 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

760 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