private void button2_Click(object sender, EventArgs e) { _scanner = new ADFScan(); _scanner.Scanning += new EventHandler <WiaImageEventArgs>(_scanner_Scanning); _scanner.ScanComplete += new EventHandler(_scanner_ScanComplete); ScanColor selectedColor = (ScanColor)_colors[comboBox1.SelectedIndex]; int dpi = (int)numericUpDown1.Value; _scanner.BeginScan(selectedColor, dpi); }
private void buttonScan_Click(object sender, EventArgs e) { try { _scanner = new ADFScan(); _scanner.Scanning += _scanner_Scanning; textBoxNumber.Text = String.Empty; _scanner.ScanComplete += _scanner_ScanComplete; _scanner.BeginScan(_color, _dpi, _deviceuuid, Path.Combine(AppDomain.CurrentDomain.BaseDirectory, iniFileName)); } catch (Exception ex) { //Log.Log.WriteLog("Main form->buttonScan_click.||||" + ex.Source + "|||" + ex.Message); if ((ex is System.Runtime.InteropServices.ExternalException) && (ex.Message == "A generic error occurred in GDI+.")) { this.Error(ex, this.Messages("resultScanCntSave")); } else { this.Error(ex, this.Messages("generalScanError")); } } }