Friday, October 10, 2025
HomeLanguagesWand path_line() function in Python

Wand path_line() function in Python

path_line() is a function specially introduced for paths. path_line() draws a line from a destination point to the point we want the line we end to. It takes only end point as argument.
 

Syntax : 
 

wand.drawing.path_line(to, relative)

Parameters:

 

Parameter Input Type Description
to sequence or (numbers.Real, numbers.Real) pair which represents coordinates to drawn to.
relative bool treat given coordinates as relative to current point.

Example #1: 
 

Python3




from wand.image import Image
from wand.drawing import Drawing
from wand.color import Color
 
with Drawing() as draw:
    draw.stroke_width = 2
    draw.stroke_color = Color('black')
    draw.fill_color = Color('white')
    draw.path_start()
 
    # Start middle-left
    draw.path_move(to =(10, 100))
 
    # Continue path to right
    draw.path_line(to =(100, 0),
                    relative = True)
 
    # Continue path to bottom left
    draw.path_line(to =(10, 80),
                    relative = True)
    draw.path_finish()
    with Image(width = 200, height = 200, background = Color('lightgreen')) as image:
        draw(image)
        image.save(filename ="pathline.png")


Output : 
 

 

Dominic
Dominichttp://wardslaus.com
infosec,malicious & dos attacks generator, boot rom exploit philanthropist , wild hacker , game developer,
RELATED ARTICLES

Most Popular

Dominic
32349 POSTS0 COMMENTS
Milvus
87 POSTS0 COMMENTS
Nango Kala
6715 POSTS0 COMMENTS
Nicole Veronica
11878 POSTS0 COMMENTS
Nokonwaba Nkukhwana
11941 POSTS0 COMMENTS
Shaida Kate Naidoo
6837 POSTS0 COMMENTS
Ted Musemwa
7097 POSTS0 COMMENTS
Thapelo Manthata
6792 POSTS0 COMMENTS
Umr Jansen
6791 POSTS0 COMMENTS