drawText
Top  Previous  Next

drawText (integer Image, string Text, integer X, integer Y,
[, floating R, integer G =R, integer B =R ] )  

Use this function to draw a string of text on an image. Equivalent to using the Text Tool. To define the font that will be used for text drawing, use
setFont. To define the transparency, use setBrush.

Parameters
 
Image  
 
An integer between 1 and 116 specifying the image frame number. Values in the range of 100-116 correspond to hidden frames.  
 
Text  
 
A string containing the text to be drawn.  
 
X, Y  
 
Positive integers specifying the coordinates of the top left corner of the text in the image.  
 
R  
 
An optional floating variable or constant specifying the color or intensity of the text. Depending on the type of the image, this parameter will be interpreted differently:  
 
Grayscale (8, 16, 32 bpp) or floating image
the intensity of the pixel
Palettized or multiphase image
the index in the image palette
RGB (16, 24, 32, 48 bpp) image
the red component of the pixel
Complex image
the first component of the pixel
 
 
Default value: established by setDrawColor.  
 
G  
An optional integer specifying the green component of the text color for an image of an RGB type. For any other image type this parameter is disregarded.  
Default value: same as R  
 
B  
An optional integer specifying the blue component of the text color for an image of an RGB type. For any other image type this parameter is disregarded.  
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 assigns a font and draw a text on a sample image:  
 
setCurDir("samples")  
loadIm(1,"sample15.iwd")  
setDrawColor(1, 255, 128, 0)  
setFont("Arial", -32, 0, FALSE, TRUE, FALSE)  
   drawText(1, "Image analysis at warp speed", 60, 97)