Click or drag to resize

AcquisitionImageAcquired Event

This event will fire for each image acquired.

Namespace:  Atalasoft.Twain
Assembly:  Atalasoft.DotTwain (in Atalasoft.DotTwain.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public event ImageAcquiredEventHandler ImageAcquired

Value

Type: Atalasoft.TwainImageAcquiredEventHandler
Remarks

All pending image acquisitions can be cancelled by setting the CancelPending property of the AcquireEventArgs to true.

To transfer the returned Bitmap to an AtalaImage when integrating with DotImage, use the AtalaImage.FromBitmap method.

When scanning multiple pages at once, this method can be used to compose a multipage image by invoking the Images.Add method of the Workspace object in DotImage.

Examples
Acquisition Class
Examples
ImageAcquiredCS (C#)
private void acquisition_ImageAcquired(object sender, Atalasoft.Twain.AcquireEventArgs e)
{
    if (e.Image != null)
        this.pictureBox1.Image = e.Image;
    else if (e.FileName != null && File.Exists(e.FileName))
        this.pictureBox1.Image = Image.FromFile(e.FileName);
}
ImageAcquiredVB (Visual Basic)
Private  Sub acquisition_ImageAcquired(ByVal sender As Object, ByVal e As Atalasoft.Twain.AcquireEventArgs)
    If Not e.Image Is Nothing Then
        Me.pictureBox1.Image = e.Image
    Else If e.FileName <> Nothing And File.Exists(e.FileName) Then 
        Me.pictureBox1.Image = Image.FromFile(e.FileName)
    End If
End Sub
See Also