VintaSoft Twain .NET SDK v10.2
Vintasoft.WpfTwain Namespace / Device Class / LoadSettings Method
Stream with device settings.
Example




In This Topic
    LoadSettings Method (Device)
    In This Topic
    Loads device settings from the stream.
    Syntax
    'Declaration
     
    Public Sub LoadSettings( _
       ByVal stream As Stream _
    ) 
    'Usage
     
    Dim instance As Device
    Dim stream As Stream
     
    instance.LoadSettings(stream)
    public void LoadSettings( 
       Stream stream
    )
    public: void LoadSettings( 
       Stream* stream
    ) 
    public:
    void LoadSettings( 
       Stream^ stream
    ) 

    Parameters

    stream
    Stream with device settings.
    Exceptions
    ExceptionDescription
    Thrown if stream is null.
    Thrown if stream does not have read access.
    Thrown if device is in wrong state.
    Thrown if device does not support profiles with settings.
    Thrown if the .NET debugger is used and the function evaluation requires all threads to run.
    Remarks
    Call this method only when device is opened (State == DeviceState.Opened).
    Example
    This example shows how to load previously saved device settings into the device.
    Public Sub LoadSettings(ByVal device As Device)
        device.Open()
        Using fs As New FileStream("scanner-setup.xml", FileMode.Open, FileAccess.Read)
            device.LoadSettings(fs)
        End Using
        device.Acquire()
    End Sub
    public void LoadSettings(Device device)
    {
        device.Open();
        using (FileStream fs = new FileStream("scanner-setup.xml", FileMode.Open, FileAccess.Read))
        {
            device.LoadSettings(fs);
        }
        device.Acquire();
    }
    Requirements

    Target Platforms: Windows 8, Windows 7, Windows Vista, Windows XP, Windows Server 2012, Windows Server 2008, Windows Server 2003

    See Also