標籤: 暫無標籤

  函數名: getcolor


  功 能: 返回當前畫線顏色


  用 法: int far getcolor(void);


  程序例:


  #include


  #include


  #include


  #include


  #include


  int main(void)


  {


  "


  int gdriver = DETECT, gmode, errorcode;


  int color, midx, midy;


  char colname[35];


  "


  initgraph(&gdriver, &gmode, "");


  "


  errorcode = graphresult();


  "


  if (errorcode != grOk)


  {


  printf("Graphics error: %s\n",


  grapherrormsg(errorcode));


  printf("Press any key to halt:");


  getch();


  "


  exit(1);


  }


  midx = getmaxx() / 2;


  midy = getmaxy() / 2;


  setcolor(getmaxcolor());


  "


  settextjustify(CENTER_TEXT, CENTER_TEXT);


  "


  color = getcolor();


  "


  itoa(color, colname, 10);


  strcat(colname,


  " is the current drawing color.");


  "


  outtextxy(midx, midy, colname);


  "


  getch();


  closegraph();


  return 0;


  }
上一篇[GetFtpConnection]    下一篇 [GetBuffer]

相關評論

同義詞:暫無同義詞