ToolBlock高级脚本之显示文本
// 用于存储要在图像上显示的图形标签的列表List<CogGraphicLabel>graphics_label=newList<CogGraphicLabel>();// 建立List// 定义了一个Arial字体,大小为12磅FontmFont1=newFont("Arial",12);// 字体12publicvoidShow_Label(doublex,doubley,CogColorConstantscolor,Fontfont,stringtext){CogGraphicLabellabel=newCogGraphicLabel();label.Alignment=CogGraphicLabelAlignmentConstants.BaselineLeft;//label.BackgroundColor = CogColorConstants.Orange;//背景颜色label.SelectedSpaceName="#";//显示的空间名称label.SetXYText(x,y,text);//显示坐标,以及输入内容label.Color=color;//字体颜色label.Font=font;//字体大小graphics_label.Add(label);//添加进入list}