VintaSoft Twain .NET SDK v10.2
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 capability of device.

    Public Sub SetDuplexEnabledCapValue(ByVal device As Vintasoft.Twain.Device)
        ' open the device
        device.Open()
    
        ' get reference to object that manipulates DuplexEnabled capability
        Dim duplexEnabledCap As Vintasoft.Twain.DeviceCapability = device.Capabilities.Find(Vintasoft.Twain.DeviceCapabilityId.DuplexEnabled)
        ' if DuplexEnabled capability supported
        If duplexEnabledCap IsNot Nothing Then
            ' set value of DuplexEnabled capability
            duplexEnabledCap.SetValue(True)
        End If
    End Sub
                  
    
    public void SetDuplexEnabledCapValue(Vintasoft.Twain.Device device)
    {
        // open the device
        device.Open();
        
        // get reference to object that manipulates DuplexEnabled capability
        Vintasoft.Twain.DeviceCapability duplexEnabledCap = device.Capabilities.Find(Vintasoft.Twain.DeviceCapabilityId.DuplexEnabled);
        // if DuplexEnabled capability supported
        if (duplexEnabledCap != null)
        {
            // set value of DuplexEnabled capability
            duplexEnabledCap.SetValue(true);
        }
    }