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 =)