private void btnSnap2_Click(object sender, EventArgs e) { if (!IsDebug()) { if (run) { MessageBox.Show("Please stop it and try again!"); } else { try { //camera.Snap(imageViewer2.Image); } catch (Exception ex) { txtInformation.AppendText(DateTime.Now.ToString() + ": Manual snap2 error!\r\n"); MessageBox.Show(ex.Message + "---Manual snap2 error!"); } } } else { ImagePreviewFileDialog imageDialog = new ImagePreviewFileDialog(); if (imageDialog.ShowDialog() == DialogResult.OK) { FileInformation fileinfo = Algorithms.GetFileInformation(imageDialog.FileName); imageViewer2.Image.Type = fileinfo.ImageType; imageViewer2.Image.ReadFile(imageDialog.FileName); } } }
private void LoadImageButton_Click(object sender, EventArgs e) { ImagePreviewFileDialog imageDialog = new ImagePreviewFileDialog(); if (imageDialog.ShowDialog() == DialogResult.OK) { FileInformation fileinfo = Algorithms.GetFileInformation(imageDialog.FileName); imageViewer.Image.Type = fileinfo.ImageType; imageViewer.Image.ReadFile(imageDialog.FileName); } }
private void browseButton_Click(object sender, EventArgs e) { ImagePreviewFileDialog dialog = new ImagePreviewFileDialog(); dialog.FileName = imagePath.Text; if (dialog.ShowDialog() == DialogResult.OK) { imagePath.Text = dialog.FileName; LoadSelectedImage(); } }
private void maskImageButton_Click(object sender, EventArgs e) { ImagePreviewFileDialog dialog = new ImagePreviewFileDialog(); dialog.FileName = maskImagePath.Text; if (dialog.ShowDialog() == DialogResult.OK) { maskImagePath.Text = dialog.FileName; LoadMaskImage(); } }
// Click the Browse button to open the file dialog private void browseButton_Click(object sender, EventArgs e) { ImagePreviewFileDialog dialog = new ImagePreviewFileDialog(); ready = false; dialog.Filter = "AIPD Images (*.apd;*.aipd)|*.apd;*.aipd|BMP Images (*.bmp)|*.bmp|JPEG Images (*.jpg;*.jpeg)|*.jpg;*.jpeg|PNG Images (*.png)|*.png|TIFF Images (*.tif;*.tiff)|*.tif;*.tiff|All Image Files|*.apd;*.aipd;*.bmp;*.jpg;*.jpeg;*.png;*.tif;*.tiff|All Files (*.*)|*||"; dialog.FilterIndex = 6; dialog.FileName = imagePath.Text; if (dialog.ShowDialog() == DialogResult.OK) { imagePath.Text = dialog.FileName; // Load the image LoadSelectedImage(); } }
private void RightCheck_Click(object sender, EventArgs e) { if (cboxLocal.Checked) { ImagePreviewFileDialog imageDialog = new ImagePreviewFileDialog(); if (imageDialog.ShowDialog() == DialogResult.OK) { LocalVI = new VisionImage(ImageType.Rgb32); LocalVI.ReadFile(imageDialog.FileName); InputImage = new Bitmap(Image.FromFile(imageDialog.FileName)); edit.RightGlueCheck(LocalVI, InputImage, (double)numComspec.Value, (double)numMarkspec.Value); } } else { edit.ReceiveCmd = "C2"; Acquire(); } }
private void RightPos_Click(object sender, EventArgs e) { if (cboxLocal.Checked) { ImagePreviewFileDialog imageDialog = new ImagePreviewFileDialog(); if (imageDialog.ShowDialog() == DialogResult.OK) { LocalVI = new VisionImage(ImageType.Rgb32); LocalVI.ReadFile(imageDialog.FileName); InputImage = new Bitmap(Image.FromFile(imageDialog.FileName)); edit.RightPosProcess(LocalVI, InputImage); } } else { edit.ReceiveCmd = "C1"; Acquire(); } }
private bool LoadImagetoImageViewer(ref ImageViewer imageViewer) { try { ImagePreviewFileDialog imageDialog = new ImagePreviewFileDialog(); if (imageDialog.ShowDialog() == DialogResult.OK) { FileInformation fileinfo = Algorithms.GetFileInformation(imageDialog.FileName); imageViewer.Image.Type = fileinfo.ImageType; imageViewer.Image.ReadFile(imageDialog.FileName); return(true); } } catch (Exception ex) { logger.ErrorFormat("Load image to imageviewer error! Error message:{0}", ex.Message); } return(false); }
// loadButton_Click is called when the Load File button is pressed. // The user is asked to load in an image to be used later in classification. private void loadButton_Click(object sender, EventArgs e) { ImagePreviewFileDialog dialog = new ImagePreviewFileDialog(); // Setup the image dialog dialog.InitialDirectory = imagePath.Text; dialog.Title = "Choose an Image to search patterns in"; // Select the image. DialogResult result = dialog.ShowDialog(); // Load the file and display if not cancelled. if (result == DialogResult.OK) { imagePath.Text = dialog.FileName; imageViewer.Image.ReadFile(imagePath.Text); imageViewer.Roi.Clear(); searchButton.Enabled = true; } }