public DialogResult SelectSource(
string sourceName
)
Public Function SelectSource( _
ByVal sourceName As String _
) As DialogResult
public:
DialogResult SelectSource(
String^ sourceName
)
sourceName
String contains source name to be selected
One of the DialogResult values. If an error occurs, an exception is thrown.
This method checks if the currently selected twain data source is TWAIN 2.x compliant or not, if not then it will load TWAIN 1.x data source manager (Twain_32.DLL) from your system and in this case the used twain version will be TwainVersion1, but if the selected data source is TWAIN 2.x compliant then TWAIN 2.x data source manager (TWAINDSM.DLL) will be loaded from your system and this case the used twain version will be TwainVersion2. This checking will be done ONLY if the SetVersion method was NOT called by the user. You can get the currently selected Twain version by calling GetVersion method. TWAIN 2.x data source manager (TWAINDSM.DLL) is always preferable if the selected data source is TWAIN 2.x compliant, so if for example you have two TWAIN drivers installed on your machine, one of them is TWAIN 2.x compliant while the other is not and you where using the TWAIN 1.x data source (driver) then you called this method and selected the other TWAIN 2.x compliant data source (driver) then LEADTOOLS will internally try to load TWAINDSM.DLL instead of Twain_32.dll in order to use TWAIN 2.x data source manager since your newly selected device is TWAIN 2.x compliant and here you might notice that the data sources listed inside the manufacturer's select source dialog are different depending on the selected TWAIN version. For more information, refer to Managing the TWAIN Source.
using Leadtools;
using Leadtools.Twain;
public void SelectSourceExample(IntPtr parent)
{
TwainSession session = new TwainSession();
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None);
if (session.SelectSource(string.Empty) != DialogResult.OK)
MessageBox.Show("Error Selecting Source");
session.Shutdown();
}
Imports Leadtools
Imports Leadtools.Twain
Public Sub SelectSourceExample(ByVal parent As IntPtr)
Dim session As TwainSession = New TwainSession()
session.Startup(parent, "manufacturer", "productFamily", "version", "application", TwainStartupFlags.None)
If session.SelectSource(String.Empty) <> DialogResult.OK Then
MessageBox.Show("Error Selecting Source")
End If
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
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.