drawPencil
Top  Previous  Next

drawPencil (integer Image, integer X, integer Y)

Use this function to draw a point on an image. The function uses the current pencil settings for the size and color of a point. Equivalent to using the Pencil 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 point in pixels.  
 
Error flags

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

The following set of statements sets the draw color and pencil size, and then draws a point on a sample image:  
 
setCurDir("samples")  
loadIm (1,"sample14.iwd")  
setDrawColor(255, 0, 0)  
setPencil (5)  
drawPencil (1, 100, 100)  
updateIm(TRUE)  
 
Remarks

To set the color and width of the pencil, use setDrawColor and setPencil.  
If you apply this function repeatedly, it is recommended to disable the screen update of the image before calling the drawing section of your script and enable the update afterwards. This will allow for significant speed increase. See updateIm for more details.