VintaSoft Twain .NET SDK 15.3: Documentation for .NET developer
Vintasoft.Twain Namespace / Device Class / XferCount Property
Syntax Exceptions Remarks Example Requirements SeeAlso
In This Topic
    XferCount Property (Device)
    In This Topic
    Gets or set a value that specifies how many images application wants to receive from the device.
    Syntax
    'Declaration
    
    Public Property XferCount As Int16
    
    
    public short XferCount { get; set; }
    
    
    public: __property short get_XferCount();
    public: __property void set_XferCount(
    short value
    );
    public:
    property short XferCount { short get(); void set(short value); }

    Property Value

    Possible values:
    -1 - application wants to receive all available images from the device;
    1..215 - application wants to receive only N images.
    Exceptions
    ExceptionDescription
    Thrown if device is in wrong state.
    Thrown if device does not support capability.
    Thrown if the .NET debugger is used and the function evaluation requires all threads to run.
    Remarks

    Call this property only when device is opened (State == DeviceState.Opened).

    Example

    This C#/VB.NET code shows how to acquire all images from the document feeder of device.

    
    Public Sub ScanImageFromFeeder(device As Vintasoft.Twain.Device)
        device.ShowUI = False
        device.DisableAfterAcquire = True
    
        device.Open()
        device.XferCount = -1
        device.PixelType = Vintasoft.Twain.PixelType.RGB
        device.UnitOfMeasure = Vintasoft.Twain.UnitOfMeasure.Inches
        device.Resolution = New Vintasoft.Twain.Resolution(200.0F, 200.0F)
    
        If device.DocumentFeeder.DuplexMode <> Vintasoft.Twain.DuplexMode.None Then
            device.DocumentFeeder.DuplexEnabled = True
        End If
    
        If device.HasFeeder Then
            device.DocumentFeeder.Enabled = True
            device.XferCount = -1
            If device.DocumentFeeder.Loaded Then
                device.DocumentFeeder.AutoFeed = True
                device.Acquire()
            End If
        End If
    End Sub
    
    
    
    public void ScanImageFromFeeder(Vintasoft.Twain.Device device)
    {
        device.ShowUI = false;
        device.DisableAfterAcquire = true;
    
        device.Open();
        device.XferCount = -1;
        device.PixelType = Vintasoft.Twain.PixelType.RGB;
        device.UnitOfMeasure = Vintasoft.Twain.UnitOfMeasure.Inches;
        device.Resolution = new Vintasoft.Twain.Resolution(200f, 200f);
    
        if (device.DocumentFeeder.DuplexMode != Vintasoft.Twain.DuplexMode.None)
            device.DocumentFeeder.DuplexEnabled = true;
    
        if (device.HasFeeder)
        {
            device.DocumentFeeder.Enabled = true;
            device.XferCount = -1;
            if (device.DocumentFeeder.Loaded)
            {
                device.DocumentFeeder.AutoFeed = true;
                device.Acquire();
            }
        }
    }
    
    

    Requirements

    Target Platforms: .NET 10; .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    See Also