c语言line函数 c语言line函数实现

C语言绘图用的Line函数,line(int x1,int y1,int x2,int y2),x1,Y1这些可以用float型的量吗

这是Turbo C中的函数,其坐标参数应该是double类型,也可以使用float或int类型,甚至char类型。

网站建设哪家好,找创新互联公司!专注于网页设计、网站建设、微信开发、微信小程序定制开发、集团企业网站建设等服务项目。为回馈新老客户创新互联还提供了兴国免费建站欢迎大家使用!

c语言中line函数内的参数的含义

line(x1,y1,x2,y2);其中两个数为一个坐标,表示从(x1,y1)画线到(x2,y2)

C语言中的图形函数有哪些

一) 像素函数

putpiel() 画像素点函数

getpixel()返回像素色函数

(二) 直线和线型函数

line() 画线函数

lineto() 画线函数

linerel() 相对画线函数

setlinestyle() 设置线型函数

getlinesettings() 获取线型设置函数

setwritemode() 设置画线模式函数

(三)、多边形函数

rectangle() 画矩形函数

bar() 画条函数

bar3d() 画条块函数

drawpoly() 画多边形函数

(四)、 圆、弧和曲线函数

getaspectratio()获取纵横比函数

circle()画圆函数

arc() 画圆弧函数

ellipse()画椭圆弧函数

fillellipse() 画椭圆区函数

pieslice() 画扇区函数

sector() 画椭圆扇区函数

getarccoords()获取圆弧坐标函数

(五)、 填充函数

setfillstyle() 设置填充图样和颜色函数

setfillpattern() 设置用户图样函数

floodfill() 填充闭域函数

fillpoly() 填充多边形函数

getfillsettings() 获取填充设置函数

getfillpattern() 获取用户图样设置函数

(六)、图像函数

imagesize() 图像存储大小函数

getimage() 保存图像函数

putimage() 输出图像函数

C语言中有什么,函数可以划线

函数名: line

功 能: 在指定两点间画一直线

用 法: void far line(int x0, int y0, int x1, int y1);

程序例:#include graphics.h

#include stdlib.h

#include stdio.h

#include conio.hint main(void)

{

/* request auto detection */

int gdriver = DETECT, gmode, errorcode;

int xmax, ymax; /* initialize graphics and local variables */

initgraph(gdriver, gmode, ""); /* read result of initialization */

errorcode = graphresult();

/* an error occurred */

if (errorcode != grOk)

{

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

grapherrormsg(errorcode));

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

getch();

exit(1);

} setcolor(getmaxcolor());

xmax = getmaxx();

ymax = getmaxy(); /* draw a diagonal line */

line(0, 0, xmax, ymax); /* clean up */

getch();

closegraph();

return 0;

}


本文题目:c语言line函数 c语言line函数实现
文章起源:http://myzitong.com/article/dohcsgg.html