//引用如下两个命名空间
using
Cognex.VisionPro; using Cognex.VisionPro.Display;
// 初始化图像
private void InitializeShapes() {
//声明矩形 CogRectangle cgRect
= new CogRectangle();
//声明圆形 CogCircle cgCirc
= new CogCircle();
//设置矩形的长宽及 X长度 Y长度 cgRect.X
= 150; cgRect.Y = 150;
//设置显示的颜色 cgRect.Color
= CogColorConstants.Green;
//选择空间名称(我也不太懂,知道的麻烦告诉下) cgRect.SelectedSpaceName
= "*";
// 设置可以交互性 cgRect.Interactive
= true; // Allow user to change the size only 只允许用户改变尺寸 cgRect.GraphicDOFEnable = CogRectangleDOFConstants.Size; cgCirc.CenterX = 220; cgCirc.CenterY = 220; cgCirc.Color = CogColorConstants.Blue; cgCirc.SelectedSpaceName = "*"; cgCirc.Interactive = true; // Allow the user to change the radius only cgCirc.GraphicDOFEnable = CogCircleDOFConstants.Radius; // 将图像显示在CogDisPlay 控件上 cogDisplay1.InteractiveGraphics.Add(cgCirc, null, false); cogDisplay1.InteractiveGraphics.Add(cgRect, null, false); }
//文件上传一份仅供参考,所用visonpro9.0 .NET4.0版本

 

相关文章:

  • 2022-02-07
  • 2021-07-24
  • 2021-08-19
  • 2021-09-11
  • 2021-10-23
  • 2021-09-19
  • 2021-11-27
  • 2021-12-30
猜你喜欢
  • 2021-12-06
  • 2022-01-25
  • 2021-12-05
  • 2021-08-26
  • 2021-10-13
  • 2021-07-01
  • 2021-12-26
相关资源
相似解决方案