FloodFill

Syntax

BOOL FloodFill(hDC,X,Y,crColor)

This function fills an area of the display surface with the current brush. The area is assumed to be bounded as specified by the crColor parameter. The FloodFill function begins at the point specified by the X and Y parameters and continues in all directions to the color boundary.

Parameter Type/Description  

hDC HDC Identifies the device context.  
X int Specifies the logical x-coordinate of the point where filling begins.  
Y int Specifies the logical y-coordinate of the point where filling begins.  
crColor COLORREF Specifies the color of the boundary.  

Return Value

The return value specifies the outcome of the function. It is nonzero if the function is successful. It is zero if the filling could not be completed, the given point has the boundary color specified by crColor, or the point is outside the clipping region.

Comments

Only memory device contexts and devices that support raster-display technology support the FloodFill function. For more information, see the RC_BITBLT raster capability in the GetDeviceCaps function, later in this chapter.