Displays the TWAIN dialog box to be used to select a TWAIN source for acquiring images.
Syntax
Visual Basic (Usage) | Copy Code |
---|
Dim instance As TwainSession
Dim sourceName As String
Dim value As DialogResult
value = instance.SelectSource(sourceName) |
Parameters
- sourceName
- String contains source name to be selected
Return Value
One of the DialogResult values.
If an error occurs, an exception is thrown.
Example
Visual Basic | Copy Code |
---|
Public Sub SelectSourceExample(ByVal parent As IWin32Window)
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 |
C# | Copy Code |
---|
public void SelectSourceExample(IWin32Window 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();
} |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0, Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7
See Also