private void Mbutton11_Click(object sender, EventArgs e) { if (camera3.IsCameraOpen()) { camera3.StopCamera(); //EnbToolBtn(true); McamStatusLbl.Text = "Idle..."; McamStatusLbl.BackColor = Color.Orange; } camera3.Grab(); }
HTuple BR = new HTuple(); //通道2的图像Row坐标 private bool BiaoDingCamera(HTuple Colunm, HTuple Row, HTuple R, int xi, string strpath) { for (int c = 0; c < 3; c++) { if (c == 0) { camera3.SetExposure(Para.RobotExposeTime); } if (c == 1) { camera3.SetExposure(Para.RobotExposeTime + Convert.ToInt32((Convert.ToDouble(Para.RobotExposeTime) * 0.2))); } if (c == 2) { camera3.SetExposure(Para.RobotExposeTime - Convert.ToInt32((Convert.ToDouble(Para.RobotExposeTime) * 0.2))); } bool GrabPass = false; for (int j = 0; j < 3; j++) { if (camera3.Grab()) { GrabPass = true; break; } Application.DoEvents(); } if (!GrabPass) { return(false); } RobotData RDate = hWndCtrl3.RobotInspect(camera3.myImage, strpath); if (RDate.Found) { Colunm[xi] = RDate.CenterX; Row[xi] = RDate.CenterY; R[xi] = RDate.CenterAngle; return(true); } } Colunm = 0; Row = 0; return(false); }