Acquisition Class |
Namespace: Atalasoft.Twain
The Acquisition type exposes the following members.
Name | Description | |
---|---|---|
Acquisition() | Creates a new instance of Acquisition. | |
Acquisition(IWin32Window) | Creates an instance of Acquisition specifying the parent window. |
Name | Description | |
---|---|---|
ApplicationIdentity | Gets the TwainIdentity object containing application information that is sent to Twain. | |
CanRaiseEvents | Gets a value indicating whether the component can raise an event. (Inherited from Component.) | |
Container | Gets the IContainer that contains the Component. (Inherited from Component.) | |
DesignMode | Gets a value that indicates whether the Component is currently in design mode. (Inherited from Component.) | |
Devices | Gets a collection of installed Device for this system. | |
Events | Gets the list of event handlers that are attached to this Component. (Inherited from Component.) | |
IsDisposed | Gets a value indicating whether this class has been disposed. | |
Parent | Gets or sets the parent window for the acquisition. | |
Site | Gets or sets the ISite of the Component. (Inherited from Component.) | |
SystemHasTwain | Gets a value indicating if the system has twain_32.dll installed. |
Name | Description | |
---|---|---|
Acquire | Acquires an image from the system default device. | |
AcquireModal | Obsolete. Acquires a single image synchronously instead of using the ImageAcquired event.
| |
CreateDeviceSession | Returns a new Device class that uses its own TwainController instead of the controller used by the Acquisition object for a single session scan. This may be required for some remote systems such as Citrix. | |
CreateObjRef | Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object. (Inherited from MarshalByRefObject.) | |
Dispose() | Releases all resources used by the Component. (Inherited from Component.) | |
Dispose(Boolean) | Closes any TWAIN connections and releases resources back to the system. (Overrides Component.Dispose(Boolean).) | |
Equals | Determines whether the specified object is equal to the current object. (Inherited from Object.) | |
Finalize | Calls Dispose(). (Overrides Component.Finalize().) | |
GetHashCode | Serves as the default hash function. (Inherited from Object.) | |
GetLifetimeService | Retrieves the current lifetime service object that controls the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
GetService | Returns an object that represents a service provided by the Component or by its Container. (Inherited from Component.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
InitializeLifetimeService | Obtains a lifetime service object to control the lifetime policy for this instance. (Inherited from MarshalByRefObject.) | |
MemberwiseClone() | Creates a shallow copy of the current Object. (Inherited from Object.) | |
MemberwiseClone(Boolean) | Creates a shallow copy of the current MarshalByRefObject object. (Inherited from MarshalByRefObject.) | |
ShowSelectSource | Displays the "Select Source" dialog, allowing end users to select the device they want to use. | |
ToString | Returns a String containing the name of the Component, if any. This method should not be overridden. (Inherited from Component.) |
Name | Description | |
---|---|---|
AcquireCanceled | This event will fire if the user has canceled the acquisition. | |
AcquireFinished | This event will fire when all of the images have been acquired. This is useful when a document feeder is
used. | |
AsynchronousException | This event is raised when an exception is thrown during an asynchronous acquisition. | |
BeforeTwainDataTransfer | This event will fire before the data is transferred from the device, allow the transfer to be canceled.
| |
DeviceEvent | This event will fire when the device sends one of the DeviceEventFlags. | |
Disposed | Occurs when the component is disposed by a call to the Dispose() method. (Inherited from Component.) | |
FileTransfer | This event will fire just before acquiring an image directly to file. You must fill in the FileName property of the FileTransferEventArgs object. | |
ImageAcquired | This event will fire for each image acquired. | |
MemoryDataTransfer | Raised during a memory transfer to allow custom handling of the image data. | |
MemoryFileTransfer | Raised during a file transfer to allow custom handling of the image data. | |
TwainDataTransfer | This event fires after the data has been transferred but before it has been processed by DotTwain.
|
Acquisition is also a component which can be added to the Visual Studio .NET toolbox. This enables properties and events to be established at design time.
// Create an instance of Acquisition and set the ImageAcquired event. Acquisition acquisition = new Acquisition(this); acquisition.ImageAcquired += new ImageAcquiredEventHandler(OnImageAcquired); private void AcquireImage() { // Acquire an image. acquisition.Acquire(); } private void OnImageAcquired(object sender, AcquireEventArgs e) { // Make sure the acquire was successful. // If so, load it into a PictureBox. if (e.Image != null) this.picture1.Image = e.Image; }
' Create an instance of Acquisition and set the ImageAcquired event. Dim acquisition As Acquisition = New Acquisition(Me) acquisition.ImageAcquired += New ImageAcquiredEventHandler(OnImageAcquired) Private Sub AcquireImage() ' Acquire an image. acquisition.Acquire() End Sub Private Sub OnImageAcquired(ByVal sender As Object, ByVal e As AcquireEventArgs) ' Make sure the acquire was successful. ' If so, load it into a PictureBox. If Not e.Image Is Nothing Then Me.picture1.Image = e.Image End If End Sub