private void bUpGrab_Click(object sender, EventArgs e) { var image = SystemEntiy.Instance[this.Module].SnapImage(Camera.Top); CommonAlgorithms.Copy(image, this.imageSet.Image); image?.Dispose(); }
private void GoTo() { SystemEntiy.Instance[this.Module].XYGoPosTillStop(this.RunData[curPcbIndex][curPcsIndex].UpPastePt); Thread.Sleep(200); var image = SystemEntiy.Instance[this.Module].SnapImage(Camera.Top); CommonAlgorithms.Copy(image, this.imageSet.Image); image?.Dispose(); this.lCur.Text = $"当前第 [{curPcbIndex + 1}] 板第 [{curPcsIndex + 1}] 个"; if (bShowCross) { this.imageSet.Image.Overlays.Default.AddLine(new LineContour(new PointContour(this.imageSet.Image.Width / 2, 0), new PointContour(this.imageSet.Image.Width / 2, this.imageSet.Image.Height)), Rgb32Value.RedColor); this.imageSet.Image.Overlays.Default.AddLine(new LineContour(new PointContour(0, this.imageSet.Image.Height / 2), new PointContour(this.imageSet.Image.Width, this.imageSet.Image.Height / 2)), Rgb32Value.RedColor); } this.bSetToSelect.BackColor = Color.Red; }
/// <summary> /// 显示视觉图像 /// </summary> /// <param name="arg1"></param> /// <param name="arg2"></param> /// <param name="arg3"></param> private void Instance_ImageShowEvent(Module arg1, Camera arg2, VisionImage arg3) { this.BeginInvoke(new Action(() => { if (arg1 == this.Module) { if (arg2 == Camera.Top) { CommonAlgorithms.Copy(arg3, imageControl1.imageSet.Image); } else if (arg2 == Camera.Bottom1) { CommonAlgorithms.Copy(arg3, imageControl2.imageSet.Image); } else if (arg2 == Camera.Bottom2) { CommonAlgorithms.Copy(arg3, imageControl3.imageSet.Image); } } arg3?.Dispose(); })); }