Using computer graphics C++ code for showing horizontal line on screen using putpixel function.

#include<conio.h>
#include<stdlib.h>
#include<math.h>
#include<dos.h>
#include<graphics.h>
void main()
{

 int d=DETECT,m;
 initgraph(&d,&m,"c:\\tc\\bgi");
for(int x=1,y=10;x<=10000;x++)
{
 putpixel(x,y,white);
}
getch();
closegraph();
}

OR



#include<conio.h>
#include<math.h>
#include<graphics.h>
#include<dos.h>
#include<stdlib.h>
void main()
{
 int d=DETECT,m;
 initgraph(&d,&m,"c:\\tc\\bgi");
for(int i=0;i<100;i++)
{
 putpixel(40+i,100,blue);
}
getch();
closegraph();
}
Posted by Unknown On Thursday, April 11, 2013 No comments

0 comments:

Post a Comment

  • RSS
  • Delicious
  • Digg
  • Facebook
  • Twitter
  • Linkedin
  • Youtube

Like us

    as

    Contact Form

    Name

    Email *

    Message *