在屏幕指定位置写出文字

楼主  收藏   举报   帖子创建时间:  2019-05-05 09:12 回复:0 关注量:993
通过Object系列函数,创建文字对象,设定纵横坐标和内容,还可以设定字体和大小

  1. void writetext(string Labelname,string data,int x,int y,color ColorValue,int FontSize)//通过Object写文字
  2. {
  3.    ObjectDelete(Labelname);
  4.    ObjectCreate(Labelname, OBJ_LABEL, 0, 0, 0);
  5.    ObjectSetText(Labelname, data, FontSize, "Arial", ColorValue);
  6.    ObjectSet(Labelname, OBJPROP_CORNER, 0);
  7.    ObjectSet(Labelname, OBJPROP_XDISTANCE, x);
  8.    ObjectSet(Labelname, OBJPROP_YDISTANCE, y);
  9. }
打赏