VintaSoft Twain .NET SDK v10.2
XferCount Property (Device)
Example 




Vintasoft.WpfTwain Namespace > Device Class : XferCount Property
Specifies how many images application wants to receive from the device.
Syntax
'Declaration
 
Public Property XferCount As Short
'Usage
 
Dim instance As Device
Dim value As Short
 
instance.XferCount = value
 
value = instance.XferCount
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 example shows how to acquire all images from the document feeder of device.
Public Sub ScanImageFromFeeder(ByVal device As Device)
    device.ShowUI = False
    device.DisableAfterAcquire = True
            
    device.Open()
    device.XferCount = -1
    device.PixelType = PixelType.RGB
    device.UnitOfMeasure = UnitOfMeasure.Inches
    device.Resolution = New Resolution(200.0F, 200.0F)
            
    If device.DocumentFeeder.DuplexMode <> 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(Device device)
{
    device.ShowUI = false;
    device.DisableAfterAcquire = true;
            
    device.Open();
    device.XferCount = -1;
    device.PixelType = PixelType.RGB;
    device.UnitOfMeasure = UnitOfMeasure.Inches;
    device.Resolution = new Resolution(200f, 200f);
            
    if (device.DocumentFeeder.DuplexMode != 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: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

See Also

Reference

Device Class
Device Members
Acquire Method
AcquireModal Method
Open Method