21xrx.com
2024-03-29 19:05:17 Friday
登录
文章检索 我的文章 写文章
C中的setlinestyle
2021-07-08 05:52:23 深夜i     --     --
C s e t l i n e s t y l e

setlinestyle 函数声明: void setlinestyle(int linestyle, unsigned pattern, int depth);

可用的线条样式:

enum line_styles
{
   SOLID_LINE,
   DOTTED_LINE,
   CENTER_LINE,
   DASHED_LINE,
   USERBIT_LINE
};

C程序

#include <graphics.h>


int main()
{
  int gd = DETECT, gm, c , x = 100, y = 50;

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

  for (c = 0; c < 5; c++)
  {
    setlinestyle(c, 0, 2);

    line(x, y, x+200, y);
    y = y + 25;
  }

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

 

  
  

评论区

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