Click or drag to resize

AcquisitionBeforeTwainDataTransfer Event

This event will fire before the data is transferred from the device, allow the transfer to be canceled.

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 BeforeTwainDataTransferEventHandler BeforeTwainDataTransfer

Value

Type: Atalasoft.TwainBeforeTwainDataTransferEventHandler
Remarks
The image information may not be exactly what the resulting image will be, since a device doesn't know for sure until it has performed the scan.
Examples
BeforeTwainDataTransferCS (C#)
private void acquisition_BeforeTwainDataTransfer(object sender, TwainDataImageInfoArgs e)
{
    // Only scan 1-bit images.
    if (e.ImageInfo.PixelType != ImagePixelType.BlackAndWhite)
        e.Cancel = true;
}
BeforeTwainDataTransferVB (Visual Basic)
Private  Sub acquisition_BeforeTwainDataTransfer(ByVal sender As Object, ByVal e As TwainDataImageInfoArgs)
    ' Only scan 1-bit images.
    If e.ImageInfo.PixelType <> ImagePixelType.BlackAndWhite Then
        e.Cancel = True
    End If
End Sub
See Also