TEnhTwain component
   TEnhTwain

Properties	Methods	Events

Unit

EnhTwain

Description

The TenhTwain component handles acquisition from any scanner installed on a system that is compatible with the TWAIN protocol.

Shareware

Please, note that this component is shareware. You can try it to see if it fits your needs but you can't sell nor use it in commercial programs. To make a long story short: you can't gain money through this component.

The component will work correctly while Delphi 2 is running.

The registration fee is, at present, 39 US$, but, for updated infos and special offers look on the web.

Over the web, you can find how to register this component at http://ascu.unian.it/~milani/delphi

If the above link should ever be moved, try looking at the DSP (Delphi Super Page) http://sunsite.icm.edu.pl/delphi.

My e-mail address is mc3078@mclink.it or milani@ascu.unian.it.


Properties

Manufacturer

Picture

ProductFamily

ProductName


Events

OnCapture


Methods

Acquire

IsTwainPresent

SelectSource


Manufacturer

Declaration

property Manufacturer: string;

Description

This property specifies the name of the manufacturer of the program that is going to acquire an image from a scanner. This is needed by the TWAIN protocol to retrieve default information for a specific software. This is used together with ProductFamily and ProductName.


ProductFamily

Declaration

property ProductFamily: string;

Description

This property specifies the product family of the program that is going to acquire an image from a scanner. This is needed by the TWAIN protocol to retrieve default information for a specific software. This is used together with Manufacturer and ProductName.


ProductName

Declaration

property ProductName: string;

Description

This property specifies the product name of the program that is going to acquire an image from a scanner. This is needed by the TWAIN protocol to retrieve default information for a specific software. This is used together with Manufacturer and ProductFamily.


Picture

Declaration

property picture: TBitmap;

Description

Run-time. This property will contain the last acquired image. Refer to this property when an OnCapture event is fired.


Acquire

Declaration

procedure acquire;

Description

This procedure will call the main dialog of the selected TWAIN source to acquire a single image. The user will be prompted for several options (depending on the installed scanner) and will be able to start acquisition.

Consider that acquisition should be considered happening asynchronously: after calling this procedure your program will, most likely, regain control immediately, even if the component tries to open the acquisition dialog as a modal one. This is probably due to the fact that most TWAIN sources have been produced for older version of Windows.

Refer to the OnCapture event to see how to acquire an image.


IsTwainPresent

Declaration

function IsTwainPresent: boolean;

Description

Returns true if the TWAIN protocol is supported by the computer. This means not that a scanner source is installed. It simply means that the supervisor of all sources exists.

You should check this to disable acquisition on those systems that have no TWAIN installed.

The component checks for TWAIN presence and links to it dynamically, so there is no error when running on systems with no TWAIN support.


SelectSource

Declaration

procedure SelectSource;

Description

This procedure will call a dialog listing all the sources available on a system. The user will be able to select one source and that source will be selected by the TWAIN manager whenever a program identified by Manufacturer, ProductFamily and ProductName will use TWAIN services again.

That means that it will be unnecessary to call SelectSource before acquiring every image even if the system rebooted.


OnCapture

Declaration

property OnCapture: TNotifyEvent;

Description

This event will be called when a new image has been acquired due to a call to the acquire procedure.

The picture will be accessible through the picture property.

Consider that not every call to the acquire procedure will be followed by an OnCaptureOnCapture event because the user might have decided to cancel acquisition.