DataSource MethodsTerminal Works - TwainScanning.Net Library

The DataSource type exposes the following members.

Methods

  NameDescription
Public methodAcquire(Boolean, Boolean, DataSourceErrorInfo, NullableTwSX, Int32)
Acquires images. Most simple way to scan. Preferred way for scanning in the console applications. Function will not return until scanning is finished.
Public methodAcquire(IImageCollector, Boolean, Boolean, NullableTwSX, NullableInt32)
Allows to acquire images from the scanner synchronously. This function will not return until scanning is finished.
Public methodAcquireAsync(IImageCollector, Boolean, Boolean, NullableTwSX, NullableInt32)
Allows to acquire images from the scanner asynchronously. This function will return immediately.
Public methodAcquireAsync(ImageCollectorOnFinishedDelegate, Boolean, Boolean, NullableTwSX, NullableInt32)
Allows to acquire images from the scanner asynchronously.
Public methodCallCustomTripletT
Public methodCancelCurrentScanning
Cancels the current scanning.

Note: Scanning is aborted, which means that images which the device already scanned but did not transfer yet are discarded. Use StopFeeder when those images have to be kept.

Public methodDispose
Closes source and performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Overrides ObjectFinalize.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodSetupFileTransferParams(TwFF, IEnumerableString, Boolean)
Public methodSetupFileTransferParams(TwFF, String, Boolean)
Public methodStopFeeder
Requests the device to stop feeding new sheets, while all images which were already scanned are still delivered. This is the graceful way to end continuous scanning - unlike CancelCurrentScanning, which aborts the acquisition and discards everything the device did not transfer yet.

Sheets which the feeder already picked up are scanned and transferred to the end, including both sides when duplex is enabled, and scanning finishes on its own once the device reports no more pending transfers - OnBatchFinished and OnScanningFinished are raised as after a complete batch.

Can be called from any thread, including from within OnSingleImageAcquired. The request is not executed immediately - the library sends DG_CONTROL / DAT_PENDINGXFERS / MSG_STOPFEEDER to the device as soon as the transfer in progress ends, because that is the TWAIN state in which data sources accept it.

Do NOT combine with CancelCurrentScanning or with CancelScanning, they would discard the pending images.

Not every device supports this operation. Use SupportsStopFeeder to check in advance and StopFeederAccepted to see whether the device actually accepted the request.

Public methodToString (Inherited from Object.)
Top
See Also

Reference