(Document/Medical only) Gets all available configurations for the current session.
public IList<TwainFastConfiguration> FindConfiguration(
int bitsPerPixel,
TwainTransferMechanism transferMechanism,
int bufferIteration
)
Public Function FindConfiguration( _
ByVal bitsPerPixel As Integer, _
ByVal transferMechanism As TwainTransferMechanism, _
ByVal bufferIteration As Integer _
) As IList(Of TwainFastConfiguration)
public:
IList<TwainFastConfiguration>^ FindConfiguration(
int bitsPerPixel,
TwainTransferMechanism transferMechanism,
int bufferIteration
)
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.
An array of the available configurations for the current session.
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();
}
Imports Leadtools
Imports Leadtools.Twain
Public Sub FindConfigurationExample(ByVal parent As IntPtr)
Dim session As TwainSession = New TwainSession()
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
Try
Dim twFastConfigs As IList(Of TwainFastConfiguration) = session.FindConfiguration(1, TwainTransferMechanism.Memory, 5)
MessageBox.Show("GetScanConfigs method was successful.")
Dim msg As String
msg = String.Format("Scan Configuration count = {0}" & Constants.vbLf, twFastConfigs.Count)
MessageBox.Show(msg)
msg = String.Format("Transfer Mode = {0}" & Constants.vbLf & "File Format = {1}" & Constants.vbLf & "Buffer Size = {2}" & Constants.vbLf & "Required Time = {3}" & Constants.vbLf, twFastConfigs(0).TransferMechanism,
twFastConfigs(0).ImageFormat, twFastConfigs(0).BufferSize, twFastConfigs(0).RequiredTime)
MessageBox.Show(msg, "Scan Configurations...")
Catch ex As Exception
MessageBox.Show(ex.Message, "Error!!!")
End Try
session.Shutdown()
End Sub
Help Collections
Raster .NET | C API | C++ Class Library | HTML5 JavaScript
Document .NET | C API | C++ Class Library | HTML5 JavaScript
Medical .NET | C API | C++ Class Library | HTML5 JavaScript
Medical Web Viewer .NET
Multimedia
Direct Show .NET | C API | Filters
Media Foundation .NET | C API | Transforms
Supported Platforms
.NET, Java, Android, and iOS/macOS Assemblies
Imaging, Medical, and Document
C API/C++ Class Libraries
Imaging, Medical, and Document
HTML5 JavaScript Libraries
Imaging, Medical, and Document