ExtFloodFill

Version 3.0

Syntax

BOOL ExtFloodFill(hDC,X,Y,crColor,wFillType)

This function fills an area of the display surface with the current brush.

If wFillType is set to FLOODFILLBORDER, the area is assumed to be completely bounded by the color specified by the crColor parameter. The ExtFloodFill function begins at the point specified by the X and Y parameters and fills in all directions to the color boundary.

If wFillType is set to FLOODFILLSURFACE, the ExtFloodFill function begins at the point specified by X and Y and continues in all directions, filling all adjacent areas containing the color specified by crColor.

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 or of the area to be filled. The interpretation of crColor depends on the value of the wFillType parameter.  
wFillType WORD Specifies the type of flood fill to be performed. It must be one of the following values:  
  Value Meaning
  FLOODFILLBORDER The fill area is bounded by the color specified by crColor. This style is identical to the filling performed by the FloodFill function.
  FLOODFILLSURFACE The fill area is defined by the color specified by crColor. Filling continues outward in all directions as long as the color is encountered. This style is useful for filling areas with multicolored boundaries.

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 (if FLOODFILLBORDER was requested)

The given point does not have the color specified by crColor (if FLOODFILLSURFACE was requested)

The point is outside the clipping region

Comments

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