Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>putpixel() plot a pixel at specified coordinates</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 putpixel()              Plot a Pixel at Specified Coordinates

 #include   <graphics.h>

 void far   putpixel(x,y,pcolor);
 int        x;
 int        y;
 int        pcolor;

    putpixel() draws a pixel at the specified coordinates ('x','y'). The
    pixel is displayed in the color 'pcolor'.

    Returns:    Nothing.

   -------------------------------- Example ---------------------------------

    The following statements print lines in colors available on specific
    graphics system.

           #include <graphics.h>

           main()
           {
               int gdriver = DETECT, gmode;
               int i, color, max, x, y, z;

               initgraph(&gdriver,&gmode,"");
               max = getmaxcolor()+1;
               y = 10;
               for (z = 1; z < 11; z++) {
                   for (i = 1; i < max; i++) {
                       for (x = 10; x < 266; x++)
                           putpixel(x,y,i);
                           y++;
                       }
                   y+=10;
                   }
               getch();
               closegraph();
           }


See Also: getpixel()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson