DataSource EventsTerminal Works - TwainScanning.Net Library

The DataSource type exposes the following members.

Events

  NameDescription
Public eventAcquiringEvent
Representing image acquiring events.
Public eventExtendedImageInformation
Public eventOnBatchFinished
Occurs when batch scanning is finish.

Raised after the last image of the batch was delivered, before the data source is disabled and before OnScanningFinished.

Public eventOnDeviceEvents
Public eventOnErrorEvent
Represents errors which occur in Twain device.
Public eventOnMemoryTransferProgressUpdate
Occurs when image chunk is transferred from scanner to this library. Occurs only when using Memory or MemFile as transfer method.
Public eventOnScanningFinished
Occurs when scanning is finish.

Last event of a scanning, raised after the data source was disabled. Reading StopFeederAccepted here is still valid.

Public eventOnSingleImageAcquired
Provides data for the Device.ImageAcquired event.

Raised once per acquired image, on the thread which drives the TWAIN message loop, and it is raised synchronously - scanning of the next image continues only after the handler returns, so keep the handler short and hand the work over to another thread when it takes longer.

Order of the operations for every image: the image is added to the collector, this event is raised, the library ends the transfer (MSG_ENDXFER) and asks the device how many transfers are still pending. The device is therefore still in the transfer state while the handler runs, which is why requests which have to reach the device in a different state - like StopFeeder - are only registered here and sent by the library at the right moment.

Order of the events for the whole scanning: AcquiringEvent and OnSingleImageAcquired per image, then OnBatchFinished when there are no more pending transfers, and finally OnScanningFinished after the data source is disabled.

Top
See Also

Reference