標籤: 暫無標籤

  函數名: getarccoords


  功 能: 取得最後一次調用arc的坐標


  用 法: void far getarccoords(struct arccoordstype far *arccoords);


  程序例:


  #include


  #include


  #include


  #include


  int main(void)


  {


  "


  int gdriver = DETECT, gmode, errorcode;


  struct arccoordstype arcinfo;


  int midx, midy;


  int stangle = 45, endangle = 270;


  char sstr[80], estr[80];


  "


  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());


  arc(midx, midy, stangle, endangle, 100);


  getarccoords(&arcinfo);


  "


  sprintf(sstr, "*- (%d, %d)",


  arcinfo.xstart, arcinfo.ystart);


  sprintf(estr, "*- (%d, %d)",


  arcinfo.xend, arcinfo.yend);


  "


  outtextxy(arcinfo.xstart,


  arcinfo.ystart, sstr);


  outtextxy(arcinfo.xend,


  arcinfo.yend, estr);


  "


  getch();


  closegraph();


  return 0;


  }
上一篇[GetBuffer]    下一篇 [美國夢八隊]

相關評論

同義詞:暫無同義詞