| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Runtime.InteropServices;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Forms;
- using WIA;
- namespace HXX.Scanner.Biz
- {
- /// <summary>
- /// 老类,似乎废弃
- /// </summary>
- public class ScanTool
- {
- public string scannerName = "";
- public WIA.Properties scannerProps = null;
- //Device scanner = null;
- //public void GetDeviceInfo(ComboBox scanList)
- public void GetDeviceInfo()
- {
- //scanList.Items.Clear();
- scanner_manager.Clear();
- DeviceManager dm = new DeviceManagerClass();
- DeviceInfos dis = dm.DeviceInfos;
- Boolean hasScanner = false;
- foreach (DeviceInfo di in dis)
- {
- //Console.WriteLine(di.Type.ToString());
- if (di.Type == WiaDeviceType.ScannerDeviceType)
- {
- scannerProps = di.Properties;
- foreach (Property p in scannerProps)
- {
- Console.WriteLine(p.Name + " > " + p.get_Value().ToString());
- if (p.Name == "Name")
- {
- scannerName = p.get_Value().ToString();
- }
- }
- hasScanner = true;
- Device_Scanner sc = new Device_Scanner(di);
- //scanList.Items.Add(sc);
- scanner_manager.Add(sc);
- }
- }
- //if (hasScanner)
- //{
- // scanList.SelectedIndex = 0;
- //}
- }
- public ImageFile test(string dir, Device_Scanner scanner, string test)
- {
- return scanner.ScanTIFFTest(dir, test);
- }
- }
- }
|