VintaSoft Twain ActiveX v6.0
In This Topic
    How to use the Dual Stream feature of Kodak scanner
    In This Topic
    ActiveX allows to use the Dual Stream feature of Kodak scanners.

    Dual Stream feature means that scanner has some "cameras" and can make some snapshots of each acquired page. Each camera has predefined settings (pixel type and page side) and customizable settings (resolution, brightness, contrast, threshold, filters, etc).

    For example, most of Kodak scanners has 6 cameras:

    Example: Here is an example that shows how to acquire both sides of page as black-white and color images with different resolutions.
    Private VSTwain1 As New VintaSoftTwain()
    ''' <summary>
    ''' Scans images asynchronously.
    ''' </summary>
    Private Sub StartScan()
        ' open the device manager
        If Not VSTwain1.DeviceManager_Open() Then
            Exit Sub
        End If
        ' select device using standard device selection dialog
        ' open the device
        If Not VSTwain1.Device_Open() Then
            Exit Sub
        End If
        ' specify that device UI must be shown
        VSTwain1.Device_ShowUI = True
        ' set settings of TIFF encoder
        VSTwain1.TiffEncoder_MultiPage = True
        ' subscribe to the device events
        AddHandler VSTwain1.DeviceImageAcquired, AddressOf VSTwain1_ImageAcquired
        AddHandler VSTwain1.DeviceScanCompleted, AddressOf VSTwain1_ScanCompleted
        AddHandler VSTwain1.DeviceScanFailed, AddressOf VSTwain1_ScanFailed
        AddHandler VSTwain1.DeviceScanCanceled, AddressOf VSTwain1_ScanCanceled
        ' use inches as unit of measure
        VSTwain1.Device_UnitOfMeasure = UNITOFMEASURE.UNITOFMEASURE_Inches
        ' enable duplex scanning
        VSTwain1.Device_Feeder_DuplexEnabled = True
        ' select color camera
        VSTwain1.Device_Cameras_SelectedCamera = "/Camera_Color_Both"
        ' set resolution for color images
        VSTwain1.Device_ImageResolution = 300
        ' enable color camera
        ' select black-white camera
        VSTwain1.Device_Cameras_SelectedCamera = "/Camera_Bitonal_Both"
        ' set resolution for black-white images
        VSTwain1.Device_ImageResolution = 200
        ' enable black-white camera
        ' acquire images asynchronously
    End Sub
    Private Sub VSTwain1_ImageAcquired()
        ' get index of acquired image
        Dim imageIndex As Integer = VSTwain1.AcquiredImages_Count - 1
        ' save acquired image to TIFF file
        If Not VSTwain1.AcquiredImages_Save(imageIndex, "test.tif") Then
        End If
    End Sub
    Private Sub VSTwain1_ScanCompleted()
        Console.WriteLine("Scan is completed.")
    End Sub
    Private Sub VSTwain1_ScanFailed(errorString As String)
        Console.WriteLine(String.Format("Scan is failed: {0}.", errorString))
    End Sub
    Private Sub VSTwain1_ScanCanceled()
        Console.WriteLine("Scan is canceled.")
    End Sub