public TwainCapability QueryCapability(
TwainCapabilityType type
)
Public Function QueryCapability( _
ByVal type As TwainCapabilityType _
) As TwainCapability
public:
TwainCapability^ QueryCapability(
TwainCapabilityType type
)
type
Indicates the capability to get.
A TwainCapability object representing all of the supported values of the requested capability.
For more information, refer to Freeing the TWAIN Session.
using Leadtools;
using Leadtools.Twain;
public void QueryCapabilityExample(IntPtr parent)
{
try
{
TwainSession twnSession = new TwainSession();
twnSession.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
TwainCapability twCap = twnSession.QueryCapability(TwainCapabilityType.ImageUnits);
if (twCap.Information.ContainerType == TwainContainerType.OneValue)
{
if (twCap.OneValueCapability.Value != (object)TwainCapabilityValue.UnitInches)
{
twCap.OneValueCapability.Value = TwainCapabilityValue.UnitInches;
twnSession.SetCapability(twCap, TwainSetCapabilityMode.Set);
}
}
twnSession.Shutdown();
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
}
Imports Leadtools
Imports Leadtools.Twain
Public Sub QueryCapabilityExample(ByVal parent As IntPtr)
Try
Dim twnSession As TwainSession = New TwainSession()
twnSession.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
Dim twCap As TwainCapability = twnSession.QueryCapability(TwainCapabilityType.ImageUnits)
If twCap.Information.ContainerType = TwainContainerType.OneValue Then
If CType(twCap.OneValueCapability.Value, TwainCapabilityValue) <> TwainCapabilityValue.UnitInches Then
twCap.OneValueCapability.Value = TwainCapabilityValue.UnitInches
twnSession.SetCapability(twCap, TwainSetCapabilityMode.Set)
End If
End If
twnSession.Shutdown()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
End Sub
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