Declaration of setlinestyle function: void setlinestyle(int linestyle, unsigned pattern, int thickness);
Available line styles:
enum line_styles
{
SOLID_LINE,
DOTTED_LINE,
CENTER_LINE,
DASHED_LINE,
USERBIT_LINE
};
{
SOLID_LINE,
DOTTED_LINE,
CENTER_LINE,
DASHED_LINE,
USERBIT_LINE
};
C program
#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;
}