VintaSoftTwain Control v6.0
VintaSoftTwain Object / Device_SetSettings Method
In This Topic
    Device_SetSettings Method
    In This Topic
    Description
    Loads device settings from string.
    Syntax
    Visual Basic
    Public Function Device_SetSettings( _
       ByVal value As Variant _
    ) As Boolean
    Parameters
    value
    Return Type
    TRUE (1) if device settings are set successfully, FALSE (0) otherwise.
    Remarks
    Call this method only when device is opened (Device_State == enumDevice_State.DeviceOpened).

    This method has effect only if user interface is not shown (Device_ShowUI == False).

    Information about error that occurs during method execution can be get using the Error and ErrorString properties.
    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
    See Also