当我们扫描分辨率为 2400dpi 或更高的文档时,我们会收到(例如)以下错误消息:
COMException: Ausnahme von HRESULT: 0x80010100 (RPC_E_SYS_CALL_FAILED)
或者
COMException:Ausnahme von HRESULT:0x8021006F
在以下行之一中
img = itm.Transfer(scanFormat.ScanFormat) as WIA.ImageFile;
img = ip.Apply(img as WIA.ImageFile);
提到的错误的一些屏幕截图:
http://www.amarant-it.de/TempDownload/WIA_Error01.png
或与 WIA_Error02.png 和 WIA_Error03.png 相同的路径
对于扫描,我们使用以下代码:
#region Image-Convert-Settings
//IP.Filters.Add IP.FilterInfos("Convert").FilterID
//IP.Filters(1).Properties("FormatID").Value = wiaFormatJPEG
WIA.IImageProcess ip = new WIA.ImageProcessClass();
object convert = "Convert";
WIA.IFilterInfo fi = ip.FilterInfos.get_Item(ref convert);
ip.Filters.Add(fi.FilterID, 0);
convert = "FormatID";
object formatstring = scanFormat.ScanFormat;
WIA.IFilter filter;
foreach (WIA.IFilter fTemp in ip.Filters)
{
filter = fTemp;
WIA.IProperty prop = filter.Properties.get_Item(ref convert);
prop.set_Value(ref formatstring);
}
#endregion
#region Image-Scan + Convert
img = itm.Transfer(scanFormat.ScanFormat) as WIA.ImageFile;
img = ip.Apply(img as WIA.ImageFile);
img.SaveFile("D:\\scan2." + img.FileExtension);
Image image = Image.FromFile("D:\\scan2." + img.FileExtension);
ilImages.Images.Add(image.ToString(), image);
alImages.Add(image);
if (ImageScanned != null)
{
ImageScanned(image);
}
#endregion
谁能帮助我们解决这个问题?
谢谢