VintaSoft Twain .NET SDK 14.1: Руководство для .NET разработчика
В этом разделе
    Как получить 48-битные цветные изображения от TWAIN сканера?
    В этом разделе
    16-разрядные серые изображения и 48-разрядные цветные изображения могут быть получены от TWAIN устройства только в режиме передачи данных Memory (Memory transfer mode).



    Вот C#/VB.NET код, который демонстрирует как получить 48-битные цветные изображений от TWAIN сканера:
    /// <summary>
    /// Acquire 48-bpp color images.
    /// </summary>
    public void Acquire48BppColorImages(Vintasoft.Twain.Device device)
    {
        // use the Memory transfer mode
        device.TransferMode = Vintasoft.Twain.TransferMode.Memory;
        // disable UI
        device.ShowUI = false;
    
        // open the device
        device.Open();
        // specify that color images must be acquired
        device.PixelType = Vintasoft.Twain.PixelType.RGB;
        // specify the bit depth for acquired images (16 - for Epson scanners, 48 - for Canon scanners)
        device.BitDepth = 16;
    
        // acquire images asynchronously
        device.Acquire();
    }
    
    ''' <summary>
    ''' Acquire 48-bpp color images.
    ''' </summary>
    Public Sub Acquire48BppColorImages(device As Vintasoft.Twain.Device)
            ' use the Memory transfer mode
            device.TransferMode = Vintasoft.Twain.TransferMode.Memory
            ' disable UI
            device.ShowUI = False
    
            ' open the device
            device.Open()
            ' specify that color images must be acquired
            device.PixelType = Vintasoft.Twain.PixelType.RGB
            ' specify the bit depth for acquired images (16 - for Epson scanners, 48 - for Canon scanners)
            device.BitDepth = 16
    
            ' acquire images asynchronously
            device.Acquire()
    End Sub
    


    Вот C#/VB.NET код, который демонстрирует как получить 16-битные цветные изображений от TWAIN сканера:
    /// <summary>
    /// Acquire 16-bpp gray images.
    /// </summary>
    public void Acquire16BppGrayImages(Vintasoft.Twain.Device device)
    {
        // use the Memory transfer mode
        device.TransferMode = Vintasoft.Twain.TransferMode.Memory;
        // disable UI
        device.ShowUI = false;
    
        // open the device
        device.Open();
        // specify that gray images must be acquired
        device.PixelType = Vintasoft.Twain.PixelType.Gray;
        // specify the bit depth for acquired images (16 - for Epson scanners, 48 - for Canon scanners)
        device.BitDepth = 16;
    
        // acquire images asynchronously
        device.Acquire();
    }
    
    ''' <summary>
    ''' Acquire 16-bpp gray images.
    ''' </summary>
    Public Sub Acquire16BppGrayImages(device As Vintasoft.Twain.Device)
            ' use the Memory transfer mode
            device.TransferMode = Vintasoft.Twain.TransferMode.Memory
            ' disable UI
            device.ShowUI = False
    
            ' open the device
            device.Open()
            ' specify that gray images must be acquired
            device.PixelType = Vintasoft.Twain.PixelType.Gray
            ' specify the bit depth for acquired images (16 - for Epson scanners, 48 - for Canon scanners)
            device.BitDepth = 16
    
            ' acquire images asynchronously
            device.Acquire()
    End Sub