VintaSoft Twain ActiveX v6.0
In This Topic
    How to set value of device capability
    In This Topic
    Example: Here is an example that shows how to enable duplex using the device capability.
    Private VSTwain1 As New VintaSoftTwain()
    
    
    Private Sub SetDuplexEnabledCapValue()
        ' open the device manager
        If Not VSTwain1.DeviceManager_Open() Then
            Console.WriteLine(VSTwain1.errorString)
            Exit Sub
        End If
    
        ' open the device
        If Not VSTwain1.Device_Open Then
            Console.WriteLine(VSTwain1.errorString)
            Exit Sub
        End If
    
        ' specify that we will work with CAP_DUPLEXENABLED capability
        VSTwain1.Device_Cap_Id = 4115
        ' if capability is supported
        If VSTwain1.Device_Cap_IsSupported() Then
            ' specify container type for capability value
            VSTwain1.Device_Cap_ValueContainerType = DEVICECAPABILITYVALUECONTAINERTYPE.DEVICECAPABILITYVALUECONTAINERTYPE_OneValue
            ' specify new capability value
            VSTwain1.Device_Cap_Value = 1 ' True
            ' set capability value
            VSTwain1.Device_Cap_Set()
        End If
    
        ' close the device
        VSTwain1.Device_Close()
    
        ' close the device manager
        VSTwain1.DeviceManager_Close()
    End Sub