QueryCapability Method

Summary
Gets all of the supported values for the requested capability.
Syntax
C#
C++
public TwainCapability QueryCapability( 
   TwainCapabilityType type 
) 
vb[VB Syntax] 
Public Function QueryCapability( _ 
   ByVal _type_ As TwainCapabilityType _ 
) As TwainCapability 
public: 
TwainCapability^ QueryCapability(  
   TwainCapabilityType type 
)  

Parameters

type
Indicates the capability to get.

Return Value

A TwainCapability object representing all of the supported values of the requested capability.

Remarks

For more information, refer to Freeing the TWAIN Session.

Example
C#
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); 
   } 
} 
Requirements

Target Platforms

Help Version 22.0.2022.4.5
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Twain Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2022 LEAD Technologies, Inc. All Rights Reserved.