VintaSoft Twain .NET SDK 15.4: Руководство для .NET разработчика
В этом разделе
Как получить изображение с разными горизонтальным и вертикальным разрешениями от TWAIN сканера изображений?
В этом разделе
Вот C#/VB.NET код, который демонстрирует, как получить изображения с разными горизонтальным и вертикальным разрешениями от TWAIN устройства:
/// <summary>
/// Acquire black-white images.
/// </summary>
public void AcquireImageWithDifferentResolutions(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, 400f);

    // acquire images asynchronously
    device.Acquire();
}
''' <summary>
''' Acquire black-white images.
''' </summary>
Public Sub AcquireImageWithDifferentResolutions(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(200.0F, 400.0F)

    ' acquire images asynchronously
    device.Acquire()
End Sub