Save(Stream) Method (DeviceCapabilityCollection)
Saves information about current values of capabilites to the stream.
The method ignores the "custom" capabilities, i.e. capabilities, which are added using the Add(UInt16) method.
This C#/VB.NET code shows how to save values of current device capabilities to a file.
''' <summary>
''' Saves the device capability collection to a file.
''' </summary>
Public Shared Sub SaveDeviceCapabilityCollection(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.Append, System.IO.FileAccess.Write)
' save the device capability collection to a file
device.Capabilities.Save(fs)
End Using
End Sub
/// <summary>
/// Saves the device capability collection to a file.
/// </summary>
public static void SaveDeviceCapabilityCollection(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.Append, System.IO.FileAccess.Write))
{
// save the device capability collection to a file
device.Capabilities.Save(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