←Select platform

QueryCapability Method

Summary
Gets all of the supported values for the requested capability.

Syntax
C#
C++/CLI
Python
public TwainCapability QueryCapability( 
   TwainCapabilityType type 
) 
public: 
TwainCapability^ QueryCapability(  
   TwainCapabilityType type 
)  
def QueryCapability(self,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 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Twain Assembly
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.