在visionPro中需要添加一些文本标签,此时会确定文本显示的相对与当前点的位置,主要有9个对齐位置,图下图示。
做个笔记。
CogGraphicLabel errorLabel = new CogGraphicLabel();
errorLabel.BackgroundColor = CogColorConstants.DarkGrey;
errorLabel.Color = CogColorConstants.Red;
errorLabel.LineWidthInScreenPixels = 4;
errorLabel.GraphicDOFEnable = CogGraphicLabelDOFConstants.None;
errorLabel.Interactive = false;
errorLabel.SelectedSpaceName = "#";
errorLabel.Font = new Font("Microsoft YaHei UI", 60, FontStyle.Bold);//显示数据字体
errorLabel.Alignment = CogGraphicLabelAlignmentConstants.BottomLeft;
//string str = "NG";
errorLabel.SetXYText(0, 0, errStr);