0

我正在使用 Gideon ( http://adfwia.codeplex.com/ ) 的 ADF 扫描仪库并遇到了一个小问题。虽然我可以扫描文件,但在保存时会引发异常。我将发布完整的代码:

private void button1_Click(object sender, EventArgs e)
    {
        ADFScan _scanner;
        int[] _colors = { 1, 2, 4 };
        int count = 0;
        _scanner = new ADFScan();
        _scanner.Scanning += new EventHandler<WiaImageEventArgs>(_scanner_Scanning);
        _scanner.ScanComplete += new EventHandler(_scanner_ScanComplete);
        ScanColor selectedColor = ScanColor.Color;
       // ScanColor selectedColor = (ScanColor)_colors[comboBox1.SelectedIndex];
        int dpi = 300;
        _scanner.BeginScan(selectedColor, dpi);


    }
    void _scanner_ScanComplete(object sender, EventArgs e)
    {
        MessageBox.Show("Scan Complete");
    }
    void _scanner_Scanning(object sender, WiaImageEventArgs e)
    {//e.ScannedImage is a System.Drawing.Image
        int count = 0;
        string filename = "C:\\test.jpg";
        e.ScannedImage.Save(filename, ImageFormat.Jpeg);//FILES ARE RETURNED AS BITMAPS


    }

程序开始扫描没有问题,实际上可以同时扫描多个页面(我需要的!)抛出的异常是this one

The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

嗯?有这方面经验的人可以帮助我吗?非常感谢提前=)

4

0 回答 0