Leadtools TWAIN (Leadtools.Twain assembly)

SetVersion Method

Show in webframe
Example 





The twain version to set, see TwainVersion for list of available versions.
Sets the desired Twain version to work with.
Syntax
public static void SetVersion( 
   TwainVersion twainVersion
)
'Declaration
 
Public Shared Sub SetVersion( _
   ByVal twainVersion As TwainVersion _
) 
'Usage
 
Dim twainVersion As TwainVersion
 
TwainSession.SetVersion(twainVersion)

            

            
public:
static void SetVersion( 
   TwainVersion twainVersion
) 

Parameters

twainVersion
The twain version to set, see TwainVersion for list of available versions.
Remarks
This method overrides the default Twain (version 2) used for scanning. This allows the Twain version to be changed without the need to rename of delete any of the Twain version DLLs from the system directory. The Twain version 1 DLL name is Twain_32.dll and version 2 DLL name is TWAINDSM.DLL, if this method is not called the engine will keep the default behavior and look for Twain version 2 first. If version 2 does not exist it will then look for Twain version1.
If this method is called and returns SUCCESS there is no need to call Leadtools.Twain.TwainSession.IsAvailable since this internally calls it.
Example
Copy Code  
Imports Leadtools
Imports Leadtools.Twain

Public Sub SetVersionExample(ByVal twainVersion As TwainVersion)
   Dim session As TwainSession = New TwainSession()

   Try
      TwainSession.SetVersion(twainVersion)
      session.Startup(Nothing, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
   Catch ex As Exception
      MessageBox.Show(ex.Message)
   End Try

   session.Shutdown()
End Sub
using Leadtools;
using Leadtools.Twain;

public void SetVersionExample(TwainVersion twainVersion)
{
   TwainSession session = new TwainSession();

   try
   {
      TwainSession.SetVersion(twainVersion);
      session.Startup(null, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
   }
   catch (Exception ex)
   {
      MessageBox.Show(ex.Message);
   }

   session.Shutdown();
}
Requirements

Target Platforms

See Also

Reference

TwainSession Class
TwainSession Members
IsAvailable Method

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.