public TwainCapability Capability { get; }
Public ReadOnly Property Capability As TwainCapability
public:
property TwainCapability^ Capability {
TwainCapability^ get();
}
The TwainCapability currently being processed by the event.
using Leadtools;
using Leadtools.Twain;
public void twnSession_SaveTemplate(object sender, TwainTemplateEventArgs e)
{
TwainCapability twCap = e.Capability;
if (twCap.Information.ContainerType == TwainContainerType.OneValue)
{
if (twCap.OneValueCapability.Value == (object)TwainCapabilityValue.TransferMechanismFile)
{
MessageBox.Show("File transfer avaialble and its container is OneValue");
}
}
}
public void CapabilityPropertyExample(IntPtr parent)
{
TwainSession session = new TwainSession();
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
session.SaveTemplate += new EventHandler<TwainTemplateEventArgs>(twnSession_SaveTemplate);
session.SaveTemplateFile(Path.Combine(LEAD_VARS.ImagesDir, "Out_test.ltt"));
session.Shutdown();
}
static class LEAD_VARS
{
public const string ImagesDir = @"C:\LEADTOOLS21\Resources\Images";
}
Imports Leadtools
Imports Leadtools.Twain
Public Sub twnSession_SaveTemplate(ByVal sender As Object, ByVal e As TwainTemplateEventArgs)
Dim twCap As TwainCapability = e.Capability
If twCap.Information.ContainerType = TwainContainerType.OneValue Then
If CType(twCap.OneValueCapability.Value, TwainCapabilityValue) = TwainCapabilityValue.TransferMechanismFile Then
MessageBox.Show("File transfer avaialble and its container is OneValue")
End If
End If
End Sub
Public Sub CapabilityPropertyExample(ByVal parent As IntPtr)
Dim session As TwainSession = New TwainSession()
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
AddHandler session.SaveTemplate, AddressOf twnSession_SaveTemplate
session.SaveTemplateFile(Path.Combine(LEAD_VARS.ImagesDir, "Out_test.ltt"))
session.Shutdown()
End Sub
Public NotInheritable Class LEAD_VARS
Public Const ImagesDir As String = "C:\LEADTOOLS21\Resources\Images"
End Class
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document