嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 2 元微信扫码支付:2 元
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
#include <stdio.h>
#include <graphics.h>
typedef struct{
int x;
int y;
}pt2;
/*declare your drawing functions.*/
void drawline(pt2 startpt, pt2 endpt, int color);
void drawcircle(pt2 centerpt, int radius, int color);
int main()
{
int color, radius;
pt2 startpt, endpt, centerpt;
/*initialize graphics driver.*/
int gdriver=VGA;
int gmode=VGAHI;
initgraph(&gdriver, &gmode, "C:\\TC20\\BGI");
/*start drawing.*/
printf("Press enter to start drawing.");
getchar();
/*invoke your drawing functions one by one.*/
startpt.x=10;
startpt.y=10;
endpt.x=300;
endpt.y=250;
color=4;
drawline(startpt, endpt, color);
centerpt.x=200;
centerpt.y=180;
radius=145;
color=8;
drawcircle(centerpt, radius, color);
/*end drawing.*/
printf("Drawing is done, press enter to exit.");
getchar();
/*close graphics driver.*/
closegraph();
}
/*
* draw line
* startpt: the start point of the line
* endpt: the end point of the line
* color: the color of the line
*/
void drawline(pt2 startpt, pt2 endpt, int color)
{
}
/*
* draw circle
* centerpt: the center of the circle
* radius: the radius of the circle
* color: the color of the circle
*/
void drawcircle(pt2 centerpt, int radius, int color)
{
}