setFillColor
Top  Previous  Next

setFillColor (integer Image, floating R [ integer G =R, integer B =R ] )

Use this function to set a current fill color for an image. The fill color is used by the
drawFlood function. It is also used by image processing functions for feeling out the areas surrounding freehand selections.

Parameters
 
Image  
 
An integer between 1 and 99 specifying the image frame number.  
 
R  
 
A floating variable or constant specifying the intensity of the fill color or the value of or its first component. Depending on the type of the active image, this parameter will be interpreted differently:  

Grayscale (8, 16, 32 bpp) or floating image
the intensity of the gray color
Palettized or multiphase image
the index in the image palette
RGB (16, 24, 32, 48 bpp) image
the red component of the color
Complex image
the active component of the complex intensity
 
 
G  
 
An optional integer specifying the green component of the fill color for an image of an RGB type.  
Default value: same as R  
 
B  
 
An optional integer specifying the blue component of the fill color for an image of an RGB type.  
Default value: same as R  
 
Error flags

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

The following set of statements sets a fill color to the high-depth blue and applies flooding to a sample image converted to 48-bit RGB:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
to48bit(1,1)  
setFillColor(1,0,65535)  
setFlood (40, 140, 192)  
drawFlood (1, 100, 100)  
updateim(1)  
 
Remark

if the type of the active image changes, ImageWarp can modify the current fill color. In order to keep the specified color, do not change the active image frame while working with drawing functions.