You are here

setlinestyle in c

Declaration:
void setlinestyle( int linestyle, unsigned upattern, int thickness );

Available line styles:

  1. enum line_styles
  2. {
  3.    SOLID_LINE,
  4.    DOTTED_LINE,
  5.    CENTER_LINE,
  6.    DASHED_LINE,
  7.    USERBIT_LINE
  8. };

C programming code

  1. #include <graphics.h>
  2.  
  3. main()
  4. {
  5.    int gd = DETECT, gm, c , x = 100, y = 50;
  6.        
  7.    initgraph(&gd, &gm, "C:\\TC\\BGI");
  8.        
  9.    for ( c = 0 ; c < 5 ; c++ )
  10.    {
  11.        setlinestyle(c, 0, 2);
  12.            
  13.        line(x, y, x+200, y);
  14.        y = y + 25;
  15.    }
  16.    
  17.    getch();
  18.    closegraph();
  19.    return 0;
  20. }