在C语言中setfillstyle是什么意思
关注:292 答案:3 手机版
解决时间 2021-01-16 20:28
提问者空城忆
2021-01-16 14:40
在C语言中setfillstyle是什么意思
最佳答案
二级知识专家趁我还喜欢
2021-01-16 16:16
函数名: setfillstyle
功 能: 设置填充模式和颜色
用 法: void far setfillstyle(int pattern, int color);
全部回答
1楼el孤酒el
2021-01-16 18:28
函数名: setfillstyle
功 能: 设置填充模式和颜色
用 法: void far setfillstyle(int pattern, int color);
程序例:
#include
#include
#include
#include
#include
char *fname[] = { "EMPTY_FILL",
"SOLID_FILL",
"LINE_FILL",
"LTSLASH_FILL",
"SLASH_FILL",
"BKSLASH_FILL",
"LTBKSLASH_FILL",
"HATCH_FILL",
"XHATCH_FILL",
"INTERLEAVE_FILL",
"WIDE_DOT_FILL",
"CLOSE_DOT_FILL",
"USER_FILL"
};
int main(void)
{
int gdriver = DETECT, gmode, errorcode;
int style, midx, midy;
char stylestr[40];
initgraph(&gdriver, &gmode, "");
errorcode = graphresult();
if (errorcode != grOk)
{
printf("Graphics error: %s\n", grapherrormsg(errorcode));
printf("Press any key to halt:");
getch();
exit(1);
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
for (style = EMPTY_FILL; style < USER_FILL; style++)
{
setfillstyle(style, getmaxcolor());
strcpy(stylestr, fname[style]);
bar3d(0, 0, midx-10, midy, 0, 0);
outtextxy(midx, midy, stylestr);
getch();
cleardevice();
}
getch();
closegraph();
return 0;
}
颜色填充:
1)SOLID_FILL 单色实填充
2)LINE_FILL 用“-”填充
3)HATCH_FILL 用方网格填充
4)XHATCH_FILL 用斜方格填充
5)WIDE_DOT_FILL用稀疏点填充
6)CLOSE_DOT_FILL用密集点填充
2楼瑾色如弦
2021-01-16 17:38
is不是c的关键字,算了我把这个表复制给你,你看不在这里面的就证明不是c的关键字,没有特别的意思: 关键字共有 32 个:( p375 ) auto break case char const continue default do double else enum extern float for goto if int long register return short signed sizeof static struct switch typedef union unsigned void volatile while 更多关于“常量”的说明 ――在前面已经简单讲了常量的定义,下面是关于常量的更多的内容。 常量与基本数据类型结合起来就是各种不同类型的常量,如: 数据类型 中文含义 常量实例 备注 int 整 型 1 123 21000 -234 long int 长整型 35000l -34l 数后面加 l 表示 short int 短整型 10 -12 90 unsigned int 无符号整型 10000u 987u 40000 数后面加 u 表示 float 浮点型 123.23f 4.34e-3f double 双精度型 123.23 12312333 -0.98765432 long double 长双精度型 1001.2l 数后面加 l
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
推荐资讯
大家都在看