←Select platform

SelectedDeviceType Property

Summary
Gets the currently selected WIA device type.

Syntax
C#
C++/CLI
Python
public WiaDeviceType SelectedDeviceType { get; } 
public: 
property WiaDeviceType SelectedDeviceType { 
   WiaDeviceType get(); 
} 
SelectedDeviceType # get  (WiaSession) 

Property Value

The currently selected WIA device type (Scanner, digital camera or streaming video).

Remarks

Gets the currently selected WIA device type. Use this property to determine the type of the device selected using any of the WiaSession.SelectDeviceDlg or WiaSession.SelectDevice methods at runtime.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.Wia; 
 
 
       
public void EnumDevicesExample(IntPtr parent) 
{ 
   if (!WiaSession.IsAvailable(WiaVersion.Version1)) 
   { 
      Console.WriteLine("WIA version 1.0 not installed."); 
      return; 
   } 
 
   WiaSession wiaSession = new WiaSession(); 
   wiaSession.Startup(WiaVersion.Version1); 
 
   DialogResult res = wiaSession.SelectDeviceDlg(parent, WiaDeviceType.Default, WiaSelectSourceFlags.NoDefault); 
   if (res != DialogResult.OK) 
   { 
      Console.WriteLine("Error selecting WIA device."); 
      wiaSession.Shutdown(); 
      return; 
   } 
 
   wiaSession.EnumDevicesEvent += new EventHandler<WiaEnumDevicesEventArgs>(wiaSession_EnumDevicesEvent); 
 
   Console.WriteLine("Available WIA Devices:\n"); 
   wiaSession.EnumDevices(); 
 
   wiaSession.EnumDevicesEvent -= new EventHandler<WiaEnumDevicesEventArgs>(wiaSession_EnumDevicesEvent); 
 
   wiaSession.Shutdown(); 
} 
 
void wiaSession_EnumDevicesEvent(object sender, WiaEnumDevicesEventArgs e) 
{ 
   string strMsg = string.Empty; 
 
   // print out some information about each device found into the console window. 
   strMsg = string.Format("\tDevice Name: {0}\n\tDevice Id: {1}\n\tDevice Description: {2}\n\n", e.DeviceName, e.DeviceID, e.DeviceDesc); 
   Console.WriteLine(strMsg); 
} 
Requirements

Target Platforms

Help Version 22.0.2023.3.31
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Wia Assembly

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.