0

I am using the ADF Scanner library by Gideon (http://adfwia.codeplex.com/) and have hit a small problem. While I can scan a file it throws an exception when saving. I'll post the full code:

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


    }

The program begins to scan without an issue, and in fact can scan multiple pages at the same time (what I needed!) The exception thrown is this one

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

Huh? Anyone with experience with this can help me? Thanks a lot in advance =)

Lord Relix
  • 922
  • 5
  • 23
  • 50
  • sorry for the bump... can anyone help? Seems to be a inherent problem in the code (tested the test app). If someone has managed to get it working I'd be really grateful. Thanks. – Lord Relix Jul 24 '13 at 14:47
  • I didn't try the code. But did you try with a different file path like D:\\test.jpg? Maybe it's a permission issue. – Rachel Aug 15 '13 at 05:39

0 Answers0