setBrush
Top  Previous  Next

setBrush ( integer Size, integer Intensity, integer Hardness, integer Space [, integer Shape ] )

Use this function to change the settings for the paintbrush. Equivalent to changing the brush settings in the Tool Preferences.

Parameters
 
Size  
 
A positive integer specifying the width of the brush tip in pixels.  
 
Intensity  
 
An integer between 0 and 100 specifying the thickness of the paint in per cent. To "dilute" or to "thicken" the paint, decrease or increase the value respectively.  
 
Hardness  
 
A integer between 0 and 100 specifying the sharpness of the brush edges in per cent. To make the edges of the paint more defined or softer, increase or decrease the value respectively.  
 
Space  
 
An integer between 0 and 100 specifying the distance between the brush marks in a stroke as a percentage of the brush size.  
 
Shape  
 
An optional enumerated integer that describes the shape of the brush. Must be one of the following values:  
 
BR_ROUND=0 – assigns the round shape to the brush tip  
BR_SQUARE=1 – assigns the square shape to the brush tip  
Default value: BR_ROUND  
 
Error flags

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

The following set of statements sets the brush parameters and applies the brush to a sample image::  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
size=8  
intensity=80  
hardness=0  
space=20  
shape=BR_ROUND  
setBrush (size, intensity, hardness, space, shape)  
drawBrush (1, 100, 100)  
redraw(1)