-
bar3d
鎖定
bar3d,計算機函數,用來畫一個三維條形圖。
- 中文名
- bar3d
- 功 能
- 畫一個三維條形圖
- 類 型
- 函數名
- 用 法
- void far bar3d
用 法:
void far bar3d(
int left, int top,// 三維空間矩形長條圖正面的左上角座標
int right, int bottom, //三維空間矩形長條圖正面的右下角座標
int depth, //三維空間矩形長條圖的深度(即陰影)
int topflag//設置是否繪製三維空間矩形長條圖的頂部
);
程序例:
#include <graphics.h>
#include
#include
#include
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;
/* initialize graphics, local variables */
initgraph(&gdriver, &gmode, "");
/* read result of initialization */
errorcode = graphresult();
if (errorcode != grOk) /* an error occurred */
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* loop through the fill patterns */
for (i=EMPTY_FILL; i
{
/* set the fill style */
setfillstyle(i, getmaxcolor());
/* draw the 3-d bar */
bar3d(midx-50, midy-50, midx+50, midy+50, 10, 1);
getch();
}
/* clean up */
closegraph();
return 0;
}
- 詞條統計
-
- 瀏覽次數:次
- 編輯次數:11次歷史版本
- 最近更新: 随便问问949