Click or drag to resize

TwainControllerBeforeTwainDataTransfer 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.0.0.0.0.297 (.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
BeforeAcquireCS (C#)
private void acquisition_BeforeTwainDataTransfer(object sender, TwainDataImageInfoArgs e)
{
    // Only scan 1-bit images.
    if (e.ImageInfo.PixelType != ImagePixelType.BlackAndWhite)
        e.Cancel = true;
}
BeforeAcquireVB (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
Examples
BeforeAcquireCS (C#)
private void acquisition_BeforeTwainDataTransfer(object sender, TwainDataImageInfoArgs e)
{
    // Only scan 1-bit images.
    if (e.ImageInfo.PixelType != ImagePixelType.BlackAndWhite)
        e.Cancel = true;
}
BeforeAcquireVB (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