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);
}
}