1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
// C++ programme for drawing line
#include <graphics.h>
int main()
{
int gd = DETECT, gm;
// initgraph initializes the graphics system
// by loading a graphics driver from disk
initgraph(&gd, &gm, "");
// line for x1, y1, x2, y2
line(150, 150, 450, 150);
// line for x1, y1, x2, y2
line(150, 200, 450, 200);
// line for x1, y1, x2, y2
line(150, 250, 450, 250);
getch();
closegraph();
}
|