private void neuesBildScannenToolStripMenuItem_Click(object sender, EventArgs e) { Image image = ScanForm.ScanSomething(this.FindForm()); if (image != null) { Data = JpegCompressor.CompressJpeg(image, MaxPictureSize); } }
public static Image ScanSomething(Form f = null) { ScanForm sf = new ScanForm(); if (sf.DialogResult == DialogResult.Abort) { return(null); } if (f == null) { sf.ShowDialog(); } else { sf.ShowDialog(f); } sf.session.Close(); return(sf.theImage); }