21xrx.com
2024-04-26 04:43:26 Friday
登录
文章检索 我的文章 写文章
c语言中的bar函数
2021-07-07 11:08:05 深夜i     --     --
c b a r

声明:void bar(int left, int top, int right, int bottom);

Bar 函数用于绘制一个二维的、填充在 bar 中的矩形。 绘制条形图需要左上角和右下角的坐标。 left 指定左上角的 X 坐标,top 指定左上角的 Y 坐标,right 指定右下角的 X 坐标,bottom 指定右下角的 Y 坐标。 当前填充图案和填充颜色用于填充条形图。 要更改填充图案和填充颜色,请使用 setfillstyle。

C程序

#include <graphics.h>
#include <conio.h>


main()
{
   int gd = DETECT, gm;

   initgraph(&gd, &gm, "C:\\TC\\BGI");

   bar(100, 100, 200, 200);

   getch();
   closegraph();
   return 0;
}

 

  
  

评论区

{{item['qq_nickname']}}
()
回复
回复