机器视觉15

图形集合
一.点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;

6. 图形基类 ICogGraphic
所有图形基于 ICogGraphic类

7.图形集合CogGraphicCollection  
包含的对象类型为 ICogGraphic      所有图形对象 都可以直接放入集合中

多种图形添加 方式:

创建多个List<>  

创建一个List<ICogGraphic >

创建一个CogGraphicCollection

  • 12
    点赞
  • 14
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值