VintaSoft Twain .NET SDK 15.1: Руководство для .NET разработчика
Vintasoft.WpfTwain Namespace / DocumentFeeder Class
Члены типа Объект Синтаксис Example Иерархия Требования Смотрите также
    Класс DocumentFeeder
    Класс, позволяющий управлять устройством автоматической подачи документов TWAIN устройства.
    Объектная модель
    DocumentFeeder
    Синтаксис
    'Declaration
    
    Public NotInheritable Class DocumentFeeder
    
    
     
    Пример

    Вот C#/VB.NET код, который демонстрирует, как использовать устройство подачи документов на устройстве.

    ''' <summary>
    ''' Acquire images from the document feeder.
    ''' </summary>
    Public Sub AcquireImagesFromAdf(device As Vintasoft.Twain.Device)
            ' disable UI
            device.ShowUI = False
    
            ' open the device
            device.Open()
            ' specify that color images must be acquired
            device.PixelType = Vintasoft.Twain.PixelType.RGB
            ' set the inches as unit of measure
            device.UnitOfMeasure = Vintasoft.Twain.UnitOfMeasure.Inches
            ' set the desired resolution of acquired images
            device.Resolution = New Vintasoft.Twain.Resolution(200F, 200F)
    
            ' if device has feeder
            If device.HasFeeder Then
                    ' enable feeder
                    device.DocumentFeeder.Enabled = True
                    ' specify that application want to acquire all pages from the feeder
                    device.XferCount = -1
    
                    ' if pages can be scanned in duplex mode
                    If device.DocumentFeeder.DuplexMode <> Vintasoft.Twain.DuplexMode.None Then
                            ' enable duplex scanning
                            device.DocumentFeeder.DuplexEnabled = True
                    End If
    
                    ' if feeder can detect paper
                    If device.DocumentFeeder.PaperDetectable Then
                            ' if feeder is loaded
                            If device.DocumentFeeder.Loaded Then
                                    ' acquire images asynchronously
                                    device.Acquire()
                            End If
                    Else
                            ' if feeder cannot detect paper
                            ' acquire images asynchronously
                            device.Acquire()
                    End If
            End If
    End Sub
    
    
    /// <summary>
    /// Acquire images from the document feeder.
    /// </summary>
    public void AcquireImagesFromAdf(Vintasoft.Twain.Device device)
    {
        // disable UI
        device.ShowUI = false;
    
        // open the device
        device.Open();
        // specify that color images must be acquired
        device.PixelType = Vintasoft.Twain.PixelType.RGB;
        // set the inches as unit of measure
        device.UnitOfMeasure = Vintasoft.Twain.UnitOfMeasure.Inches;
        // set the desired resolution of acquired images
        device.Resolution = new Vintasoft.Twain.Resolution(200f, 200f);
    
        // if device has feeder
        if (device.HasFeeder)
        {
            // enable feeder
            device.DocumentFeeder.Enabled = true;
            // specify that application want to acquire all pages from the feeder
            device.XferCount = -1;
    
            // if pages can be scanned in duplex mode
            if (device.DocumentFeeder.DuplexMode != Vintasoft.Twain.DuplexMode.None)
                // enable duplex scanning
                device.DocumentFeeder.DuplexEnabled = true;
    
            // if feeder can detect paper
            if (device.DocumentFeeder.PaperDetectable)
            {
                // if feeder is loaded
                if (device.DocumentFeeder.Loaded)
                    // acquire images asynchronously
                    device.Acquire();
            }
            // if feeder cannot detect paper
            else
                // acquire images asynchronously
                device.Acquire();
        }
    }
    
    

    Иерархия наследования

    System.Object
       Vintasoft.WpfTwain.DocumentFeeder

    Требования

    Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5

    Смотрите также