Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_floodfill() fill area with current color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _floodfill()            Fill area with current color

 #include   <graph.h>

 short far _floodfill( x, y, boundary );
  short x, y;            Logical coordinates of starting point
  short boundary;        Boundary color, where fill stops

    _floodfill() fills an area of the display using the current color and
    fill mask. Filling starts at the logical point (x, y) and continues
    in all directions until stopped by the color of boundary. If the
    starting point lies inside a figure, the interior is filled. If it
    lies outside a figure, the background is filled. It cannot lie on the
    figure boundary itself, nor outside the clipping region.

       Returns:     If successful, _floodfill() returns a nonzero value.
                    It returns 0 if unsuccessful, for example if the fill
                    could not be completed, if the starting point lies on
                    the boundary color, or if the start point lies
                    outside the clipping region.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

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

    This program draws an ellipse and fills the background.

           #include <conio.h>
           #include <graph.h>

           main()
           {
              short color;
              int i;

              _setvideomode( _MRES4COLOR );
              color = _getcolor();
              _ellipse( _GBORDER, 90, 60, 250, 160 );

              _floodfill( 60, 30, color );

              while ( !kbhit() );
              _setvideomode( _DEFAULTMODE );
           }


See Also: _setcolor() _setfillmask() _setcliprgn() _getcolor()

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