這是Turbo C中的函數(shù),其坐標參數(shù)應(yīng)該是double類型,也可以使用float或int類型,甚至char類型。
網(wǎng)站建設(shè)哪家好,找創(chuàng)新互聯(lián)公司!專注于網(wǎng)頁設(shè)計、網(wǎng)站建設(shè)、微信開發(fā)、微信小程序定制開發(fā)、集團企業(yè)網(wǎng)站建設(shè)等服務(wù)項目。為回饋新老客戶創(chuàng)新互聯(lián)還提供了興國免費建站歡迎大家使用!
line(x1,y1,x2,y2);其中兩個數(shù)為一個坐標,表示從(x1,y1)畫線到(x2,y2)
一) 像素函數(shù)
putpiel() 畫像素點函數(shù)
getpixel()返回像素色函數(shù)
(二) 直線和線型函數(shù)
line() 畫線函數(shù)
lineto() 畫線函數(shù)
linerel() 相對畫線函數(shù)
setlinestyle() 設(shè)置線型函數(shù)
getlinesettings() 獲取線型設(shè)置函數(shù)
setwritemode() 設(shè)置畫線模式函數(shù)
(三)、多邊形函數(shù)
rectangle() 畫矩形函數(shù)
bar() 畫條函數(shù)
bar3d() 畫條塊函數(shù)
drawpoly() 畫多邊形函數(shù)
(四)、 圓、弧和曲線函數(shù)
getaspectratio()獲取縱橫比函數(shù)
circle()畫圓函數(shù)
arc() 畫圓弧函數(shù)
ellipse()畫橢圓弧函數(shù)
fillellipse() 畫橢圓區(qū)函數(shù)
pieslice() 畫扇區(qū)函數(shù)
sector() 畫橢圓扇區(qū)函數(shù)
getarccoords()獲取圓弧坐標函數(shù)
(五)、 填充函數(shù)
setfillstyle() 設(shè)置填充圖樣和顏色函數(shù)
setfillpattern() 設(shè)置用戶圖樣函數(shù)
floodfill() 填充閉域函數(shù)
fillpoly() 填充多邊形函數(shù)
getfillsettings() 獲取填充設(shè)置函數(shù)
getfillpattern() 獲取用戶圖樣設(shè)置函數(shù)
(六)、圖像函數(shù)
imagesize() 圖像存儲大小函數(shù)
getimage() 保存圖像函數(shù)
putimage() 輸出圖像函數(shù)
函數(shù)名: 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函數(shù) c語言line函數(shù)實現(xiàn)
鏈接URL:http://muchs.cn/article16/dohcsgg.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、定制開發(fā)、電子商務(wù)、云服務(wù)器、外貿(mào)建站、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)