drawFlood
Top  Previous  Next

drawFlood (integer Image, integer X, integer Y)

Use this function to fill an area of connected similar pixels with the current Fill color. The function uses the current flood, brush and color settings. Equivalent to using the Flood Tool.

Parameters
 
Image  
 
An integer between 1 and 116 specifying the image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
X, Y  
 
Positive integers specifying the coordinates of the initial point for flooding.  
 
Error flags

ERR_OK  
 
The flag set if successful.  
 
ERR_FAILED  
 
The flag set if failed.  
 
Example

The following set of statements sets the fill color, brush and flood parameters, and then applies flooding to a sample image.  
 
hue=40  
light=140  
sat=192  
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
duplicate (1,2)  
setFillColor(1,255, 96, 255)  
setFlood (hue, light, sat)  
drawFlood (2, 100, 100)  
updateim(2)  
 
Remark

To set the fill color and flood tolerance, use setFillColor and setBrush. To establish the transparency of flooding, use setBrush.