VisionPro 编写C#脚本
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 }
上一篇:Cognex InSight 相机的连接与仿真的使用
C# VisionPro
pla文件怎么看,pla文件用什么打开?
pl1文件怎么看,pl1文件用什么打开?
pl文件怎么看,pl文件用什么打开?
pl0文件怎么看,pl0文件用什么打开?
pkt文件怎么看,pkt文件用什么打开?
pkm文件怎么看,pkm文件用什么打开?
pks文件怎么看,pks文件用什么打开?
pka文件怎么看,pka文件用什么打开?
pkh文件怎么看,pkh文件用什么打开?
pkg文件怎么看,pkg文件用什么打开?