Intel® Fortran Compiler 18.0 Developer Guide and Reference

FLOODFILLRGB, FLOODFILLRGB_W (W*S)

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

Module

USE IFQWIN

result = FLOODFILLRGB (x,y,color)

result = FLOODFILLRGB_W (wx,wy,color)

x, y

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

color

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

wx, wy

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

Results

The result type is 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.

Example

! Build as a QuickWin or Standard Graphics App.
USE IFQWIN
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(Z'008080') ! red
status = RECTANGLE( $GBORDER, x1, y1, x2, y2 )
bcolor = GETCOLORRGB( )
result = SETCOLORRGB (Z'FF0000') ! blue
xinterior = 160; yinterior = 100
result = FLOODFILLRGB (xinterior, yinterior, bcolor)
END

See Also