Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _floodfill( short x, short y,
                           short stop_color );

    short _FAR _floodfill_w( double x, double y,
                             short stop_color );

Description:
    The _floodfill functions fill an area of the screen.  The _floodfill
    function uses the view coordinate system.  The _floodfill_w function
    uses the window coordinate system.

    The filling starts at the point (x,y) and continues in all directions:
     when a pixel is filled, the neighbouring pixels (horizontally and
    vertically) are then considered for filling.  Filling is done using the
    current color and fill mask.  No filling will occur if the point (x,y)
    lies outside the clipping region.

    If the argument stop_color is a valid pixel value, filling will occur in
    each direction until a pixel is encountered with a pixel value of
    stop_color.  The filled area will be the area around (x,y), bordered by
    stop_color.  No filling will occur if the point (x,y) has the pixel
    value stop_color.

    If stop_color has the value (-1), filling occurs until a pixel is
    encountered with a pixel value different from the pixel value of the
    starting point (x,y).  No filling will occur if the pixel value of the
    point (x,y) is the current color.

Returns:
    The _floodfill functions return zero when no filling takes place; a
    non-zero value is returned to indicate that filling has occurred.

See Also:
    _setcliprgn, _setcolor, _setfillmask, _setplotaction

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

    main()
    {
        _setvideomode( _VRES16COLOR );
        _setcolor( 1 );
        _ellipse( _GBORDER, 120, 90, 520, 390 );
        _setcolor( 2 );
        _floodfill( 320, 240, 1 );
        getch();
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
     _floodfill - DOS, QNX

    _floodfill_w - DOS, QNX

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