1 using System;
2 using Cognex.VisionPro;
3 using Cognex.VisionPro3D;
4 using Cognex.VisionPro.ToolGroup;
5 using System.Windows.Forms;
6 using System.Drawing ;
7 using Cognex.VisionPro.ImageProcessing ;
8 using Cognex.VisionProaliper;
9
10
11 public class UserScript : CogToolGroupBaseScript
12
45
46 #region "When the Current Run Record is Created"
47 public override void ModifyCurrentRunRecord(Cognex.VisionPro.ICogRecord currentRecord)
48
50 #endregion
51
52 #region "When the Last Run Record is Created"
53 // Allows you to add or modify the contents of the last run record when it is
54 // created. For example, you might add cust graphics to the run record here.
55 public override void ModifyLastRunRecord(Cognex.VisionPro.ICogRecord lastRecord)
56 pixel", Radius);
59 ResultLabel.SetXYText(myCircleenterX, myCircleenterY, labelStr);
60 ResultLabelolor = Cognex.VisionProogColorConstants.Blue;
61 ResultLabel.SelectedSpaceName = @"@\Fixture";
62 toolGroup.AddGraphicToRunRecord(ResultLabel, lastRecord, "Image Source.OutputImage", "script");
toolGroup.AddGraphicToRunRecord(myCircle, lastRecord, "Image Source.OutputImage", "script");
64 /*
65 Should only be called fr tool group script. Adds a graphic to a specified run record
66 参数一: A CogGraphic object to add
67 参数二: A tree of CogRecords
68 参数三: The name of the specific record where the graphic should be added
69 参数四: A key string used to identify your graphic
70 */
71
72 for( int i = 0 ;i < myCF.Resultsount 1;i++)
73
78
79
80 }
81 #endregion
82
83 #region "When the Script is Initialized"
84 // Perform any initialization required by your script here
85 public override void Initialize(CogToolGroup host)
86
92 #endregion
93
94 }
上一篇:VisionPro 物体长度测量
下一篇:VisionPro 圆形物体直径测量
C VisionPro









