请输入您要查询的百科知识:

 

词条 circle:C
释义

函数作用:画圆

头文件:graphics.h

原形:void far circle(int x, int y, int radius)

参数:x,y为圆心坐标,RADIUS为半径

例:

#include <graphics.h>

#include <stdlib.h>

#include <stdio.h>

#include <conio.h>

int main(void)

{

int gdriver = DETECT, gmode, errorcode;

int midx, midy;

int radius = 100;

initgraph(&gdriver, &gmode, );

errorcode = graphresult();

if (errorcode != grOk)

{

printf("Graphics error: %s

", grapherrormsg(errorcode));

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

getch();

exit(1);

}

midx = getmaxx() / 2;

midy = getmaxy() / 2;

setcolor(getmaxcolor());

circle(midx, midy, radius);

getch();

closegraph();

return 0;

}

随便看

 

百科全书收录4421916条中文百科知识,基本涵盖了大多数领域的百科知识,是一部内容开放、自由的电子版百科全书。

 

Copyright © 2004-2023 Cnenc.net All Rights Reserved
更新时间:2025/3/1 20:23:54