Load(Stream) Method (DeviceCapabilityCollection)
Loads current values of capabilities from the stream.
This C#/VB.NET code shows how to load previously saved values of device capabilities.
''' <summary>
''' Loads the device capability collection from file.
''' </summary>
''' <param name="device"></param>
Public Shared Sub LoadDeviceCapabilityCollection(device As Vintasoft.Twain.Device)
' open the device
device.Open()
' open file
Using fs As New System.IO.FileStream("scanner-capabilities.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read)
' load the device capability collection from file
device.Capabilities.Load(fs)
End Using
End Sub
/// <summary>
/// Loads the device capability collection from file.
/// </summary>
/// <param name="device"></param>
public static void LoadDeviceCapabilityCollection(Vintasoft.Twain.Device device)
{
// open the device
device.Open();
// open file
using (System.IO.FileStream fs = new System.IO.FileStream("scanner-capabilities.xml", System.IO.FileMode.Open, System.IO.FileAccess.Read))
{
// load the device capability collection from file
device.Capabilities.Load(fs);
}
}
Target Platforms: .NET 9; .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5