WIA 2.0 not scanning  
Author Message
jsbWS





PostPosted: Visual C# General, WIA 2.0 not scanning Top

I am writing a windows control that runs a scanner. Everything works fine in WIA 1.0, but when I try and use WIA 2.0 it does not.

I am starting from the sample application from http://www.hide-link.com/

Anyway the following code finds the scanner properly,

DeviceManager manager = new DeviceManagerClass();
foreach (DeviceInfo info in manager.DeviceInfos) {
if (info.Type == WiaDeviceType.ScannerDeviceType) {
device = info.Connect();
break;
}
}

When I iterate through the commands, I get the following:
"Synchronize"
"Delete Device Tree"
"Build Device Tree"

None of these commands has anything to do with capturing an image. When I try and
execute the code:

Item item = device.ExecuteCommand(cmdID);

Where the id is any of the above I get a System.ArgumentException that the
parameter is correct.

When I try and use "CommandID.wiaCommandTakePicture" for the command id,
I get a System.NotImplementedException

What am I missing There is no problem using WIA 1.0

Thanks,
Jon






Visual C#4  
 
 
shax





PostPosted: Visual C# General, WIA 2.0 not scanning Top

Hi,
Did you ever manage to find out a solution to your problem. I am having the same issues.

Cheers

 
 
Julie Knibbe





PostPosted: Visual C# General, WIA 2.0 not scanning Top

Hi!

Did you try this

CommonDialogClass class1 = new CommonDialogClass();
Device d = class1.ShowSelectDevice(WiaDeviceType.UnspecifiedDeviceType, true, false);

//To acquire your file
d.Items[1].Transfer(WIA.FormatID.wiaFormatJPEG);

See http://www.eggheadcafe.com/community/aspnet/10/10006654/previous-community-conver.aspx

Cheers,
Julie