Leadtools.Wia Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
SelectDeviceDlg Method
See Also 
Leadtools.Wia Namespace > WiaSession Class : SelectDeviceDlg Method



owner
Window handle of your application window.
deviceType
Specifies which type of WIA device to use. Possible values are:

Value

Meaning

WiaDeviceType.Default Generic WIA device. During device enumerations, this constant is used to enumerate all WIA devices. This is the default value.
WiaDeviceType.Scanner The device is a scanner.
WiaDeviceType.DigitalCamera The device is a camera. Note that this type of device is not supported by Windows Vista and later.
WiaDeviceType.StreamingVideo The device contains streaming video. Note that this type of device is not supported by Windows Server 2003, Windows Vista, or later.
flags
Flag that determines certain actions of the WIA image acquisition selection dialog box. Possible values are:

Value

Meaning

WiaSelectSourceFlags.None Default behavior for the device image acquisition dialog box.
WiaSelectSourceFlags.NoDefault Display the dialog box even if there is only one matching device.
owner
Window handle of your application window.
deviceType
Specifies which type of WIA device to use. Possible values are:

Value

Meaning

WiaDeviceType.Default Generic WIA device. During device enumerations, this constant is used to enumerate all WIA devices. This is the default value.
WiaDeviceType.Scanner The device is a scanner.
WiaDeviceType.DigitalCamera The device is a camera. Note that this type of device is not supported by Windows Vista and later.
WiaDeviceType.StreamingVideo The device contains streaming video. Note that this type of device is not supported by Windows Server 2003, Windows Vista, or later.
flags
Flag that determines certain actions of the WIA image acquisition selection dialog box. Possible values are:

Value

Meaning

WiaSelectSourceFlags.None Default behavior for the device image acquisition dialog box.
WiaSelectSourceFlags.NoDefault Display the dialog box even if there is only one matching device.
Displays a dialog box that enables the user to select a WIA hardware device for image acquisition.

Syntax

Visual Basic (Declaration) 
Public Function SelectDeviceDlg( _
   ByVal owner As IWin32Window, _
   ByVal deviceType As WiaDeviceType, _
   ByVal flags As WiaSelectSourceFlags _
) As DialogResult
Visual Basic (Usage)Copy Code
Dim instance As WiaSession
Dim owner As IWin32Window
Dim deviceType As WiaDeviceType
Dim flags As WiaSelectSourceFlags
Dim value As DialogResult
 
value = instance.SelectDeviceDlg(owner, deviceType, flags)
C# 
public DialogResult SelectDeviceDlg( 
   IWin32Window owner,
   WiaDeviceType deviceType,
   WiaSelectSourceFlags flags
)
C++/CLI 
public:
DialogResult SelectDeviceDlg( 
   IWin32Window owner,
   WiaDeviceType deviceType,
   WiaSelectSourceFlags flags
) 

Parameters

owner
Window handle of your application window.
deviceType
Specifies which type of WIA device to use. Possible values are:

Value

Meaning

WiaDeviceType.Default Generic WIA device. During device enumerations, this constant is used to enumerate all WIA devices. This is the default value.
WiaDeviceType.Scanner The device is a scanner.
WiaDeviceType.DigitalCamera The device is a camera. Note that this type of device is not supported by Windows Vista and later.
WiaDeviceType.StreamingVideo The device contains streaming video. Note that this type of device is not supported by Windows Server 2003, Windows Vista, or later.
flags
Flag that determines certain actions of the WIA image acquisition selection dialog box. Possible values are:

Value

Meaning

WiaSelectSourceFlags.None Default behavior for the device image acquisition dialog box.
WiaSelectSourceFlags.NoDefault Display the dialog box even if there is only one matching device.

Return Value

One of the DialogResult values. If an error occurs, an exception is thrown.

Example

Remarks

This function creates and displays the Select Device dialog box so the user can select a WIA device for image acquisition.

Particular types of devices may be displayed to the user by specifying the device types through the deviceType parameter.

If only one device meets the specification, the SelectDeviceDlg does not display the Select Device dialog box. Override this behavior and force the SelectDeviceDlg to display the Select Device dialog box by passing NoDefault as the value for the flags parameter.

Note:

WIA 2.0 does not support cameras or streaming video.

Note:

You do not need to call this method if you are using the high-level WiaSession.AcquireSimple method, since it handles session initialization, session end, and device selection automatically.

For more information, refer to How to Acquire from the WIA Source.

For more information, refer to Managing WIA Sources.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows 2000, Windows XP, Windows Vista, Windows Server 2003 family, Windows Server 2008 family

See Also