日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

c语言标准图形库,C语言图形库函数.docx

發布時間:2023/12/20 编程问答 26 豆豆
生活随笔 收集整理的這篇文章主要介紹了 c语言标准图形库,C语言图形库函数.docx 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1?初始化圖形系統

函數名:ini tgraph

功能:初始化圖形系統

用 法:void far initgraph(int far *graphdriver, int far *grciphmode, char far *pathtodriver);

程序例:

^include

★include

^include #includo int main(void)

{

/* request auto detection */

int gdriver = DETEC1\ gmode, errorcode;

/* initialize graphics mode */

initgraph(&gdriver, &gmode,"“);

/* read result of initialization */

errorcode 二 graphresult():

if (errorcode != grOk) /* an error occurred */

(

prin tf (''Graphics error: %s\n: grapherrormsg (errorcode)):

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

getch ();

exi t(1);/* return wi th error code */

/* draw a line */

line(0, 0, gctmaxx0, gctmaxy());

/* clean up */

getch ();

closegraph ();

return 0;

2.

函數名:

drawpoly

功能:

畫多邊形

用法:

void far drawpoly(int numpoints, int far *polypoints);

程序例:

#include〈graphics? h>

★include

^include

#include irH main(void)

{

/* request auto detection */

int gdriver = DETECT, gmode, errorcode; int maxx, mcixy;

/* our polygon array */

int polyL1OJ;

/* initialhe graphics and local variables */

initgraph(&gdriver, &gmode,;

/* read result of initialization */ errorcode = graphresult();

if (errorcode != grOk)

/* an error occurred */

{

printf(^Graphics error: %s\n", \ grapherrormsg(orrorcode));

prin訂("Press any key to halt/); getch ();

/? terminate with an error code */ exi t (1);

}

meixx = getmeixx ();

mcixy = getmcixy 0 ;

poly[0] = 20;/* 1st vertext */

poly[1] = maxy / 2;

poly[2] = maxx - 20; /* 2nd */ poly[3] = 20;

poly [4] = maxx - 50; /* 3rd */ poly [5] = maxy - 20;

poly[6] = maxx / 2;/* 4th */

poly[7] = maxy / 2;

/*

drawpoly doesn't automatically close the polygon, so we close il?

poly [8] = poly[0]: poly[9] = poly[l]:

/* draw the polygon */ drawpoly(5, poly);

/* clean up */ getchO ; elosegraph ();

return 0;

}

函數名:

ellipse

功能:

畫一橢圓

用法:

void far ellipse(int x, int y, int stangle, int endangle,

int

程序例:

xradius, int yradius);

#include #include #includo ^inc

總結

以上是生活随笔為你收集整理的c语言标准图形库,C语言图形库函数.docx的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。