图形集合
一.点CogPointMarker
CogPointMarker PointMarker1 = new CogPointMarker();//创建对象,点CogPointMarker //注意运行工具 PointMarker1.X = 100; PointMarker1.Y = 100;//点坐标 PointMarker1.Color = CogColorConstants.Red;//点颜色设置 PointMarker1.LineWidthInScreenPixels = 20;//点大小设置
二.直线CogLine
CogLine Line1 = new CogLine();//创建对象,直线CogLine Line1.X = 10; Line1.Y = 10;//线坐标,也可以用 Line1.Rotation设置角度 Line1.Color = CogColorConstants.Red;//直线颜色设置 Line1.LineWidthInScreenPixels = 20;//直线宽度三.矩形CogRectangle
CogRectangle Rectangle1 = new CogRectangle();//创建对象,矩形CogRectangle Rectangle1.X = 200; Rectangle1.Y = 100;//矩形坐标 Rectangle1.Width = 100; Rectangle1.Height = 100;//矩形长宽,也可以用 Rectangle1.Rotation设置角度 Rectangle1.Color = CogColorConstants.Red;//颜色 Rectangle1.LineWidthInScreenPixels = 20;四.圆形 CogCircle
CogCircle Circle1 = new CogCircle();////创建对象,矩形CogRectangle Circle1.CenterX = 192; Circle1.CenterY = 100;//圆坐标 Circle1.Radius = 10;//圆半径 Circle1.Color = CogColorConstants.Red;//圆颜色 Circle1.LineWidthInScreenPixels = 20;//圆线宽度五.多边形 CogPolygon
CogPolygon p = new CogPolygon();
p = mBlob.Results.GetBlobs()[i].GetBoundary();
p.Color = CogColorConstants.Red;
六. 图形基类 ICogGraphic
所有图形基于 ICogGraphic类(接口)
七.图形集合CogGraphicCollection
包含的对象类型为 ICogGraphic 所有图形对象 都可以直接放入集合中
多种图形添加 方式:
创建多个List<>
创建一个List<ICogGraphic>
创建一个CogGraphicCollection
vp脚本在vs中调试方式
作用:利用vs断点调试模式 对程序进行排错
1.开启VisionPro脚本调试功能
if (system.diagnostics.debugger.isattached)
if (system.diagnostics.debugger.isattached) 用于检测当前进程是否有调试器附加
system.diagnostics.debugger.break();主动触发调试器中断,在代码里手动打了一个断点调试
1.打开Visual Studio软件
1.选择附加 搜索Cog 程序
2.在附加的进程上选择VisionPro脚本的进程
1.运行
设置断点调试