Top  Previous  Next

drawLine (integer Image, integer X1, integer Y1, integer X2, integer Y2
[, floating R, integer G =R, integer B =R, integer Width ] )  

Use this function to draw a straight-line segment on an image. Equivalent to using the Line Tool.

An integer between 1 and 116 specifying the image frame number. Values in the range of 100-116 correspond to hidden frames.  
X1, Y1, X2, Y2  
Positive integers specifying the coordinates of the end points of the line in pixels.  
An optional floating variable or constant specifying the color or intensity of the line. 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.  
An optional integer specifying the green component of line color for an image of an RGB type  
Default value: same as R  
An optional integer specifying the blue component of the line color for an image of an RGB type. For any other image type this parameter is disregarded.  
Default value: same as R  
An optional integer between 0 and 100 specifying the width of the line in pixels.  
Default value: established by setPencil.  
Error flags

The flag set if successful.  
The flag set if failed.  

The following set of statements creates a blank 16-bit grayscale image and draws a diagonal line with the intensity 40000.  
createIm (1, IM_GRAY16, 256, 256)  
drawLine (1, 0, 0, 255, 255, 40000)