当前位置:首页 » 编程语言 » barc语言

barc语言

发布时间: 2022-05-20 18:06:24

1. c语言的BAR函数的使用方法

参考文献:网络功 能: 画一个二维条形图
用 法: void far bar(int left, int top, int right, int bottom);
程序例:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;
/* initialize 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(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* loop through the fill patterns */
for (i=SOLID_FILL; i<USER_FILL; i++)
{
/* set the fill style */
setfillstyle(i, getmaxcolor());
/* draw the bar */
bar(midx-50, midy-50, midx+50,
midy+50);
getch();
}
/* clean up */
closegraph();
return 0;
} 这些看了应该会了吧~

2. C语言中的颜色和边框的函数怎么来运用···

if(c=='-')
{
if(strcmp(str2,"")==0) /*如果str2为空,说明是负号,而不是减号*/
flag=-1; /*设置负数标志*/
else
{
num1=atof(str2); /*将第二个操作数转换为浮点数*/
strcpy(str2,""); /*将str2清空*/
act=2; /*做计算减法标志值*/
setfillstyle(SOLID_FILL,color+3);
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*画矩形*/
outtextxy(5*width,height,"0."); /*显示字符串*/
}
}
if(c=='*')
{
num1=atof(str2); /*将第二个操作数转换为浮点数*/
strcpy(str2,""); /*将str2清空*/
act=3; /*做计算乘法标志值*/
setfillstyle(SOLID_FILL,color+3); bar(2*width+width/2,height/2,15*width/2,3*height/2);
outtextxy(5*width,height,"0."); /*显示字符串*/
}
if(c=='/')
{
num1=atof(str2); /*将第二个操作数转换为浮点数*/
strcpy(str2,""); /*将str2清空*/
act=4; /*做计算除法标志值*/
setfillstyle(SOLID_FILL,color+3);
bar(2*width+width/2,height/2,15*width/2,3*height/2);
outtextxy(5*width,height,"0."); /*显示字符串*/
}
if(c=='^')
{
num1=atof(str2); /*将第二个操作数转换为浮点数*/
strcpy(str2,""); /*将str2清空*/
act=5; /*做计算乘方标志值*/
setfillstyle(SOLID_FILL,color+3); /*设置用淡绿色实体填充*/
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*画矩形*/
outtextxy(5*width,height,"0."); /*显示字符串*/
}
if(c=='%')
{
num1=atof(str2); /*将第二个操作数转换为浮点数*/
strcpy(str2,""); /*将str2清空*/
act=6; /*做计算模运算乘方标志值*/
setfillstyle(SOLID_FILL,color+3); /*设置用淡绿色实体填充*/
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*画矩形*/
outtextxy(5*width,height,"0."); /*显示字符串*/
}
if(c=='=')
{
num2=atof(str2); /*将第二个操作数转换为浮点数*/
switch(act) /*根据运算符号计算*/
{
case 1:result=num1+num2;break; /*做加法*/
case 2:result=num1-num2;break; /*做减法*/
case 3:result=num1*num2;break; /*做乘法*/
case 4:result=num1/num2;break; /*做除法*/
case 5:result=pow(num1,num2);break; /*做x的y次方*/
case 6:result=fmod(num1,num2);break; /*做模运算*/
}
setfillstyle(SOLID_FILL,color+3); /*设置用淡绿色实体填充*/
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*覆盖结果区*/
sprintf(temp,"%f",result); /*将结果保存到temp中*/
outtextxy(5*width,height,temp); /*显示结果*/
}
if(c=='c')
{
num1=0; /*将两个操作数复位0,符号标志为1*/
num2=0;
flag=1;
strcpy(str2,""); /*将str2清空*/
setfillstyle(SOLID_FILL,color+3); /*设置用淡绿色实体填充*/
bar(2*width+width/2,height/2,15*width/2,3*height/2); /*覆盖结果区*/
outtextxy(5*width,height,"0."); /*显示字符串*/
}
if(c=='Q')exit(0); /*如果选择了q回车,结束计算程序*/
}
putimage(x,y,rar,XOR_PUT); /*在退出之前消去光标箭头*/
return; /*返回*/
}
/*窗口函数*/
void mwindow( char *header )
{
int height;
cleardevice(); /* 清除图形屏幕 */
setcolor( MaxColors - 1 ); /* 设置当前颜色为白色*/
setviewport( 20, 20, MaxX/2, MaxY/2, 1 ); /* 设置视口大小 */
height = textheight( "H" ); /* 读取基本文本大小 */
settextstyle( DEFAULT_FONT, HORIZ_DIR, 1 );/*设置文本样式*/
settextjustify( CENTER_TEXT, TOP_TEXT );/*设置字符排列方式*/
outtextxy( MaxX/4, 2, header ); /*输出标题*/
setviewport( 20,20+height+4, MaxX/2+4, MaxY/2+20, 1 ); /*设置视口大小*/
drawboder(); /*画边框*/
}
void drawboder(void) /*画边框*/
{
struct viewporttype vp; /*定义视口类型变量*/
setcolor( MaxColors - 1 ); /*设置当前颜色为白色 */
setlinestyle( SOLID_LINE, 0, NORM_WIDTH );/*设置画线方式*/
getviewsettings( &vp );/*将当前视口信息装入vp所指的结构中*/
rectangle( 0, 0, vp.right-vp.left, vp.bottom-vp.top ); /*画矩形边框*/
}
/*设计鼠标图形函数*/
int arrow()
{
int size;
int raw[]={4,4,4,8,6,8,14,16,16,16,8,6,8,4,4,4}; /*定义多边形坐标*/
setfillstyle(SOLID_FILL,2); /*设置填充模式*/
fillpoly(8,raw); /*画出一光标箭头*/
size=imagesize(4,4,16,16); /*测试图象大小*/
rar=malloc(size); /*分配内存区域*/
getimage(4,4,16,16,rar); /*存放光标箭头图象*/
putimage(4,4,rar,XOR_PUT); /*消去光标箭头图象*/
return 0;
}
/*按键函数*/
int specialkey(void)
{
int key;
while(bioskey(1)==0); /*等待键盘输入*/
key=bioskey(0); /*键盘输入*/
key=key&0xff? key&0xff:key>>8; /*只取特殊键的扫描值,其余为0*/
return(key); /*返回键值*/
}

3. c语言的bar()函数和 rectangle()函数

bar画一个填充矩形 填充颜色由 setfillstyle决定
rectangle画一个空矩形框,线条颜色由setcolor决定

4. c语言bar函数怎么用

bar函数:
功 能: 画一个二维条形图
用 法: void far bar(int left,int top,int right,int bottom);
程序例:
#include <graphics.h>
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
int main(void)
{
/* request auto detection */
int gdriver = DETECT,gmode,errorcode;
int midx,midy,i;
/* initialize 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(errorcode));
printf("Press any key to halt:");
getch();
exit⑴; /* terminate with an error code */
}
midx = getmaxx() / 2;
midy = getmaxy() / 2;
/* loop through the fill patterns */
for (i=SOLID_FILL; i<USER_FILL; i++)
{
/* set the fill style */
setfillstyle(i,getmaxcolor());
/* draw the bar */
bar(midx-50,midy-50,midx+50,
midy+50);
getch();
}
/* clean up */
closegraph();
return 0;
}

5. C语言程序里"BAR"是什么意思

函数名: bar
功 能: 画一个二维条形图
用 法: void far bar(int left, int top, int right, int bottom);
程序例:

#include
#include
#include
#include

int main(void)
{
/* request auto detection */
int gdriver = DETECT, gmode, errorcode;
int midx, midy, i;

/* initialize 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(errorcode));
printf("Press any key to halt:");
getch();
exit(1); /* terminate with an error code */
}

midx = getmaxx() / 2;
midy = getmaxy() / 2;

/* loop through the fill patterns */
for (i=SOLID_FILL; i
{
/* set the fill style */
setfillstyle(i, getmaxcolor());

/* draw the bar */
bar(midx-50, midy-50, midx+50,
midy+50);

getch();
}

/* clean up */
closegraph();
return 0;
}

6. 什么是BRA什么是BAR

确切的来说 bra是内衣 不过指的是上边的内衣 就是胸罩
bar是组的意思是棍子,酒吧间 在VC中可能解释为条比较合理

7. 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() 输出图像函数

8. C语言 easyx里面 bar(120,130,340,250)具体是什么意思只知道bar是画

你好,这里是bar的详细参数说明:
bar
这个函数用于画无边框填充矩形。
void bar(int left,int top,int right,int bottom);
参数:
left矩形左部 x 坐标。
top矩形上部 y 坐标。
right矩形右部 x 坐标。
bottom矩形下部 y 坐标。

麻烦采纳一下。

9. c语言代码里面有个int foo=7,int bar=4,这是什么意思呢

定义一个整型变量,变量名叫foo, 给 foo赋值为7
定义一个整型变量,变量名叫bar, 给 bar赋值为4

热点内容
python集合运算符 发布:2025-02-14 03:06:18 浏览:204
pic编译软件 发布:2025-02-14 03:01:04 浏览:983
反编译在编译 发布:2025-02-14 02:55:36 浏览:417
python打印对象 发布:2025-02-14 02:51:20 浏览:572
QRM算法 发布:2025-02-14 02:45:19 浏览:265
c语言打印结构体 发布:2025-02-14 02:42:28 浏览:140
编译技术实验一 发布:2025-02-14 02:28:24 浏览:647
编程手机入门 发布:2025-02-14 02:27:40 浏览:733
局域网视频android 发布:2025-02-14 02:23:56 浏览:423
麒麟系统如何安装安卓程序 发布:2025-02-14 02:07:21 浏览:399