Draw Line VI
- Updated2025-07-30
- 3 minute(s) read
Draws a line from the current pen position to the specified location in a picture.
The end point is either absolute or relative to the current position, depending on the value of the absolute coordinates? input.

Inputs/Outputs
picture
—
picture is the picture to which you want to add the line. The default is an empty picture.
end point
—
end point is the end point of the new line. If absolute coordinates? is TRUE, the line draws to the absolute coordinate that end point specifies. If absolute coordinates? is FALSE, the line draws relative to the current pen location in picture.
absolute coordinates?(T)
—
absolute coordinates? specifies whether the point new position is in absolute or relative coordinates. The default is absolute (TRUE).
color(black)
—
color is the color of the pixel. The default is black. You can wire a color box constant to this input.
pen
—
pen sets the width and style of the pen the VI uses to draw the picture.
new picture
—
new picture is the picture that contains the new image. You can wire this output to any other picture input to add more drawing instructions to the picture. You also can wire this output to the Picture to Pixmap VI to obtain an image data cluster. You then can use the Graphics Formats VIs to save the image data to a file. You can wire this output to the Concatenate Strings function to concatenate the output from multiple Picture Functions VIs so that they draw on a single picture control. |
Examples
Refer to the following example files included with LabVIEW.
- labview\examples\Graphics and Sound\2D Picture Control\Pen Attributes And Image subsetting.vi
picture
—
end point
—
x
—
absolute coordinates?(T)
—
color(black)
—
Width
—
Style
—
new picture
—