Leadtools TWAIN (Leadtools.Twain assembly)
LEAD Technologies, Inc

GetCapability Method

Example 





The capability to get.
The capability values to get.
Gets the TwainCapability value at the specified index from the array of capabilities supported by the selected TWAIN source.
Syntax
public TwainCapability GetCapability( 
   TwainCapabilityType type,
   TwainGetCapabilityMode mode
)
'Declaration
 
Public Function GetCapability( _
   ByVal type As TwainCapabilityType, _
   ByVal mode As TwainGetCapabilityMode _
) As TwainCapability
'Usage
 
Dim instance As TwainSession
Dim type As TwainCapabilityType
Dim mode As TwainGetCapabilityMode
Dim value As TwainCapability
 
value = instance.GetCapability(type, mode)
public TwainCapability GetCapability( 
   TwainCapabilityType type,
   TwainGetCapabilityMode mode
)
 function Leadtools.Twain.TwainSession.GetCapability( 
   type ,
   mode 
)
public:
TwainCapability^ GetCapability( 
   TwainCapabilityType type,
   TwainGetCapabilityMode mode
) 

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
 
Public Sub GetCapabilityExample(ByVal parent As IWin32Window)
   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
public void GetCapabilityExample(IWin32Window 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();
}
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also

Reference

TwainSession Class
TwainSession Members
QuerySupportedCapabilities Method
SetCapability Method
QueryCapability Method

 

 


Products | Support | Contact Us | Copyright Notices

© 2006-2012 All Rights Reserved. LEAD Technologies, Inc.