VintaSoft Twain ActiveX v6.0
In This Topic
    How to create predefined session setup for high-volume scanner
    In This Topic
    ActiveX allows to load/save predefined session setups for mid- and high-volume scanners.


    Example: Here is an example that shows how to get the current device settings as byte array.
    Private VSTwain1 As New VintaSoftTwain()
    
    
    ''' <summary>
    ''' Returns the device settings as byte array.
    ''' </summary>
    Private Function GetDeviceSettingsAsByteArray() As Byte()
        ' open the device manager
        If Not VSTwain1.DeviceManager_Open() Then
            Throw New ApplicationException(VSTwain1.errorString)
        End If
    
        ' open the device
        If Not VSTwain1.Device_Open Then
            Throw New ApplicationException(VSTwain1.errorString)
        End If
    
        ' get device settings as byte array
        Dim settings As Byte() = CType(VSTwain1.Device_GetSettings(), Byte())
        Return settings
    End Function


    Example: Here is an example that shows how to load previously saved device settings into the device.
    Private VSTwain1 As New VintaSoftTwain()
    
    
    ''' <summary>
    ''' Returns the device settings as byte array.
    ''' </summary>
    Private Sub LoadDeviceSettingsAsByteArray(settings As Byte())
        ' open the device manager
        If Not VSTwain1.DeviceManager_Open() Then
            Throw New ApplicationException(VSTwain1.errorString)
        End If
    
        ' open the device
        If Not VSTwain1.Device_Open Then
            Throw New ApplicationException(VSTwain1.errorString)
        End If
    
        ' set device settings
        If Not VSTwain1.Device_SetSettings(settings) Then
            Throw New ApplicationException(VSTwain1.errorString)
        End If
    End Sub