GetCapability Method

Summary
Gets the TwainCapability value at the specified index from the array of capabilities supported by the selected TWAIN source.
Syntax
C#
VB
C++
Public Function GetCapability( _ 
   ByVal type As TwainCapabilityType, _ 
   ByVal mode As TwainGetCapabilityMode _ 
) As TwainCapability 

Parameters

type
The capability to get.

mode
The capability values to get.

Return Value

A TwainCapability object that represents the specified capability value(s).

Remarks

For more information, refer to Freeing the TWAIN Session.

Example
C#
VB
using Leadtools; 
using Leadtools.Twain; 
 
public void GetCapabilityExample(IntPtr parent) 
{ 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   TwainCapability twCap; 
   twCap = session.GetCapability(TwainCapabilityType.ImageUnits, TwainGetCapabilityMode.GetCurrent); 
   if (twCap == null) 
      MessageBox.Show("Error Getting Capability"); 
 
   session.Shutdown(); 
} 
Imports Leadtools 
Imports Leadtools.Twain 
 
Public Sub GetCapabilityExample(ByVal parent As IntPtr) 
   Dim session As TwainSession = New TwainSession() 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None) 
 
   Dim twCap As TwainCapability 
   twCap = session.GetCapability(TwainCapabilityType.ImageUnits, TwainGetCapabilityMode.GetCurrent) 
   If twCap Is Nothing Then 
      MessageBox.Show("Error Getting Capability") 
   End If 
 
   session.Shutdown() 
End Sub 
Requirements

Target Platforms

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

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