FLOODFILLRGB, FLOODFILLRGB_W

Graphics Function: Fills an area using the current Red-Green-Blue (RGB) color and fill mask.

Module: USE DFLIB

Syntax

result = FLOODFILLRGB (x, y, color)
result = FLOODFILLRGB_W (wx, wy, color)


x, y
(Input) INTEGER(2). Viewport coordinates for fill starting point.


wx, wy
(Input) REAL(8). Window coordinates for fill starting point.


color
(Input) INTEGER(4). RGB value of the boundary color.

Results:

The result is of type INTEGER(4). The result is a nonzero value if successful; otherwise, 0 (occurs if the fill could not be completed, or if the starting point lies on a pixel with the boundary color color, or if the starting point lies outside the clipping region).

FLOODFILLRGB begins filling at the viewport-coordinate point (x, y). FLOODFILLRGB_W begins filling at the window-coordinate point (wx, wy). The fill color used by FLOODFILLRGB and FLOODFILLRGB_W is set by SETCOLORRGB. You can obtain the current fill color by calling GETCOLORRGB.

If the starting point lies inside a figure, the interior is filled; if it lies outside a figure, the background is filled. In both cases, the fill color is the current color set by SETCOLORRGB. The starting point must be inside or outside the figure, not on the figure boundary itself. Filling occurs in all directions, stopping at pixels of the boundary color color.

Compatibility

STANDARD GRAPHICS QUICKWIN GRAPHICS LIB

See Also: ELLIPSE, FLOODFILL, GETCOLORRGB, GETFILLMASK, GRSTATUS, PIE, SETCLIPRGN, SETCOLORRGB, SETFILLMASK

Example

! Build as a QuickWin or Standard Graphics App.
USE DFLIB
INTEGER(2) status
INTEGER(4) result, bcolor
INTEGER(2) x1, y1, x2, y2, xinterior, yinterior
x1 = 80; y1 = 50
x2 = 240; y2 = 150
result = SETCOLORRGB(#008080) ! red
status = RECTANGLE( $GBORDER, x1, y1, x2, y2 )
bcolor = GETCOLORRGB( )
result = SETCOLORRGB (#FF0000) ! blue
xinterior = 160; yinterior = 100
result = FLOODFILLRGB (xinterior, yinterior, bcolor)
END