←Select platform

FindConfiguration Method

Summary
(Document/Medical only) Gets all available configurations for the current session.

Syntax
C#
C++/CLI
Python
def FindConfiguration(self,bitsPerPixel,transferMechanism,bufferIteration): 

Parameters

bitsPerPixel
The resulting file's pixel depth.

Note that not all bits per pixel are available to all file formats. Use 0 for bitsPerPixel to store the file using the closest BitsPerPixel value supported by that format.

transferMechanism
The TWAIN transfer mode to use.

bufferIteration
The number of memory configurations that will be tested. The maximum value for this parameter is 10.

Return Value

An array of the available configurations for the current session.

Remarks

For more information, refer to Fast TWAIN (Scan Configurations).

Example
C#
using Leadtools; 
using Leadtools.Twain; 
 
 
public void FindConfigurationExample(IntPtr parent) 
{ 
   TwainSession session = new TwainSession(); 
   session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None); 
 
   try 
   { 
      IList<TwainFastConfiguration> twFastConfigs = session.FindConfiguration(1, TwainTransferMechanism.Memory, 5); 
 
      MessageBox.Show("GetScanConfigs method was successful."); 
      string msg; 
 
      msg = String.Format("Scan Configuration count = {0}\n", twFastConfigs.Count); 
      MessageBox.Show(msg); 
 
      msg = String.Format("Transfer Mode = {0}\nFile Format = {1}\nBuffer Size = {2}\nRequired Time = {3}\n", 
         twFastConfigs[0].TransferMechanism, 
         twFastConfigs[0].ImageFormat, 
         twFastConfigs[0].BufferSize, 
         twFastConfigs[0].RequiredTime); 
      MessageBox.Show(msg, "Scan Configurations..."); 
   } 
   catch (Exception ex) 
   { 
      MessageBox.Show(ex.Message, "Error!!!"); 
   } 
   session.Shutdown(); 
} 
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.