Load(Stream) Метод (DeviceCapabilityCollection)
Загружает текущие значения возможностей из потока.
Вот C#/VB.NET код, который демонстрирует, как загрузить ранее сохраненные значения возможностей устройства.
''' <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);
}
}
Целевые платформы: .NET 8; .NET 7; .NET 6; .NET Framework 4.8, 4.7, 4.6, 4.5, 4.0, 3.5