private void FormRefresh(bool isAutoFit) { this.aqDisplay1.InteractiveGraphics.Clear(); if (null != _producer.ImageIn) { this.aqDisplay1.Image = _producer.ImageIn.Clone() as Bitmap; if (_producer.IsDisplay) { for (int index = 0; index < _device.TaskSize; ++index) { ShapeOf2D.ConvertRectToShapeOf2D(Rectangle.Truncate(_device.Roi[index]), out var shapeOf2D); DisplayContour.GetContours(shapeOf2D.XldPointYs, shapeOf2D.XldPointXs, shapeOf2D.XldPointsNums, out var contours, _aqColor[index], 2); DisplayContour.Display(this.aqDisplay1, contours); } } } if (isAutoFit) { this.aqDisplay1.FitToScreen(); } this.aqDisplay1.Update(); return; }
private void FormRefresh() { if (null != _tileImage.SingleImage && null == _tileImage.WholeImage) { _currImage = _tileImage.SingleImage.Clone() as Bitmap; } if (null != _tileImage.WholeImage) { _currImage = _tileImage.WholeImage.Clone() as Bitmap; } this.aqDisplay1.InteractiveGraphics.Clear(); if (null != _currImage) { this.aqDisplay1.Image = _currImage; if (null != _currDisplayShape) { DisplayContour.Display(this.aqDisplay1, _currDisplayShape); } } this.aqDisplay1.FitToScreen(); this.aqDisplay1.Update(); return; }
private void RefreshAqDisplayOfCheck(bool isSelected = false, int indexOfDefectRegion = 0) { this.aqDisplayOfCheck.Show(); this.aqDisplayOfCheck.InteractiveGraphics.Clear(); if (null == _defectCell || null == _defectCell.DefectImage) { this.aqDisplayOfCheck.Hide(); return; } this.aqDisplayOfCheck.Image = _defectCell.DefectImage.Clone() as Bitmap; foreach (var defectRegion in _defectCell.DefectRegions) { List <AqShap> aqShape = new List <AqShap>(); if (isSelected && indexOfDefectRegion == _defectCell.DefectRegions.IndexOf(defectRegion)) { DisplayContour.GetContours(defectRegion.XldYs, defectRegion.XldXs, defectRegion.XldPointCount, out aqShape, AqVision.Graphic.AqColorEnum.Green, 3); } else { DisplayContour.GetContours(defectRegion.XldYs, defectRegion.XldXs, defectRegion.XldPointCount, out aqShape, AqVision.Graphic.AqColorEnum.Red, 1); } DisplayContour.Display(aqDisplayOfCheck, aqShape); } this.aqDisplayOfCheck.FitToScreen(); this.aqDisplayOfCheck.Update(); return; }
private void FormRefresh(bool isAutoFit) { this.aqDisplay1.InteractiveGraphics.Clear(); if (null != _detector.ImageIn) { this.aqDisplay1.Image = _detector.ImageIn.Clone() as Bitmap; if (_detector.IsDisplay) { // if (_detector.IsDisplayOfDefect) { if (null != _detector.ProductManager.DefectParam.Region && 0 != _detector.ProductManager.DefectParam.Region.XldPointsNums.Count) { var temp = _detector.ProductManager.DefectParam.Region; DisplayContour.GetContours(temp.XldPointYs, temp.XldPointXs, temp.XldPointsNums, out var shape, AqVision.Graphic.AqColorEnum.Green, 2); DisplayContour.Display(this.aqDisplay1, shape); } } // if (_detector.IsDisplayOfBadConnection) { if (null != _detector.ProductManager.BadConnectionParam.Region && 0 != _detector.ProductManager.BadConnectionParam.Region.XldPointsNums.Count) { var temp = _detector.ProductManager.BadConnectionParam.Region; DisplayContour.GetContours(temp.XldPointYs, temp.XldPointXs, temp.XldPointsNums, out var shape, AqVision.Graphic.AqColorEnum.Red, 2); DisplayContour.Display(this.aqDisplay1, shape); } } // if (_detector.IsDisplayOfOverage) { if (null != _detector.ProductManager.OverageParam.Region && 0 != _detector.ProductManager.OverageParam.Region.XldPointsNums.Count) { var temp = _detector.ProductManager.OverageParam.Region; DisplayContour.GetContours(temp.XldPointYs, temp.XldPointXs, temp.XldPointsNums, out var shape, AqVision.Graphic.AqColorEnum.Blue, 2); DisplayContour.Display(this.aqDisplay1, shape); } } // if (_detector.IsDisplayOfOffset) { if (null != _detector.ProductManager.OffsetParam.Region && 0 != _detector.ProductManager.OffsetParam.Region.XldPointsNums.Count) { var temp = _detector.ProductManager.OffsetParam.Region; DisplayContour.GetContours(temp.XldPointYs, temp.XldPointXs, temp.XldPointsNums, out var shape, AqVision.Graphic.AqColorEnum.Yellow, 2); DisplayContour.Display(this.aqDisplay1, shape); } // ShapeOf2D.ConverPoint2DToCross(_detector.ProductManager.OffsetParam.StandardPoint, 3, out var standardPoint); DisplayContour.GetContours(standardPoint.XldPointYs, standardPoint.XldPointXs, standardPoint.XldPointsNums, out var shapeOfStandardPoint, AqVision.Graphic.AqColorEnum.Yellow, 4); DisplayContour.Display(this.aqDisplay1, shapeOfStandardPoint); // ShapeOf2D.ConverPoint2DToCross(_detector.ProductManager.OffsetParam.CurrPoint, 3, out var currPoint); DisplayContour.GetContours(currPoint.XldPointYs, currPoint.XldPointXs, currPoint.XldPointsNums, out var shapeOfCurrPoint, AqVision.Graphic.AqColorEnum.Yellow, 2); DisplayContour.Display(this.aqDisplay1, shapeOfCurrPoint); } // if (_detector.IsDisplayOfTip) { if (null != _detector.ProductManager.TipParam.Region && 0 != _detector.ProductManager.TipParam.Region.XldPointsNums.Count) { var temp = _detector.ProductManager.TipParam.Region; DisplayContour.GetContours(temp.XldPointYs, temp.XldPointXs, temp.XldPointsNums, out var shape, AqVision.Graphic.AqColorEnum.Orange, 2); DisplayContour.Display(this.aqDisplay1, shape); } } } } if (isAutoFit) { this.aqDisplay1.FitToScreen(); } this.aqDisplay1.Update(); return; }