-
linerel
鎖定
- 中文名
- linerel
- 功 能
- 從當前位置點(
- 用 法
- void far linerel(int dx, int
- 程序例
- #include
linerel定義
函數名: linerel
功 能: 從當前位置點(CP)到與CP有一給定相對距離的點畫一直線
用 法: void far linerel(int dx, int dy);
linerel示例
#include
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
char msg[80];
/* initialize graphics and local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n",
grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
/* move the C.P. to location (20, 30) */
moveto(20, 30);
/* create and output a
message at (20, 30) */
sprintf(msg, " (%d, %d)", getx(), gety());
outtextxy(20, 30, msg);
/* draw a line to a point a relative
distance away from the current
value of C.P. */
linerel(100, 100);
/* create and output a message at C.P. */
sprintf(msg, " (%d, %d)", getx(), gety());
outtext(msg);
/* clean up */
getch();
closegraph();
return 0;
}
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:7次歷史版本
- 最近更新: vlluyanz395