public FormHome() { try { InitializeComponent(); } catch (Exception ex) { Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption); } }
public frmProduction() { try { InitializeComponent(); //cam = new Camera("abedCam"); cam = new Camera("DirectShow", "[0] Logitech HD Pro Webcam C920"); // [0] Lenovo EasyCamera // cam = new Camera(); //Window = hWindowControl1.HalconWindow; } catch (Exception ex) { Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption); } }
private void btnGrabImage_Click(object sender, EventArgs e) { try { //cam.GrabImage().DispObj(Window); hWndView1.dispObject(cam.GrabImage()); /* * String fileName = "particle"; * HImage image = new HImage(fileName); * hWndView1.dispObject(image); */ } catch (Exception ex) { Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption); } }
private void btnGrabImage_Click(object sender, EventArgs e) { try { //CoreCV.DeviceManager.cam = new Camera("DirectShow", "[0] Logitech HD Pro Webcam C920"); string path = Directory.GetCurrentDirectory(); CoreCV.DeviceManager.cam = new Camera("File", "Default", "test", path + @"\dataRep\Vision\Cameras\default\test"); //CoreCV.DeviceManager.cam = new Camera("CASS2"); hWndView1.dispObject(CoreCV.DeviceManager.cam.GrabImage()); hWndView1.listBoxDiagnostic.Items.Add(CoreCV.DeviceManager.cam.CameraName); CoreCV.DeviceManager.cam.Dispose(); CoreCV.DeviceManager.cam = null; } catch (HOperatorException ex) { Utilitiy.write_error(this.GetType().FullName, System.Reflection.MethodBase.GetCurrentMethod().ToString(), ex, DataType.eErrors.Exeption); hWndView1.listBoxDiagnostic.Items.Add(ex.ToString()); } }