private void GrabImgBtn_Click(object sender, EventArgs e) { if (GrabedImg != null) { GrabedImg.Dispose(); } CameraCtrl.Instance.GrabImg(TeachCaliPara.cam, out GrabedImg); //采集图像 view1.Refresh(); view1.AddViewImage(GrabedImg); view1.Repaint(); }
private void ContinueGrabBtn_Click(object sender, EventArgs e) { ContinueGrabBtn.Enabled = false; IsContinnueGrab = true; System.Threading.Tasks.Task.Factory.StartNew(new Action(() => { while (IsContinnueGrab) { if (GrabedImg != null) { GrabedImg.Dispose(); } if (CameraCtrl.Instance.GrabImg(TeachCaliPara.camLightPara.CamName, out GrabedImg)) { view1.ResetView(); view1.Refresh(); view1.AddViewImage(GrabedImg); view1.Repaint(); } System.Threading.Thread.Sleep(100); } })); }