Open In App

Wand path_move() function in Python

Last Updated : 10 May, 2020
Improve
Improve
Like Article
Like
Save
Share
Report

path_move() is another function introduced in wand for paths. The main aim of path_move() function is to set new starting point for a new sub_path. Given to parameter can be relative, or absolute, by setting the relative flag.

Syntax :

wand.drawing.path_move(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:




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()
    # set starting point for first sub-path
    draw.path_move(to =(10, 10))
    # Drawing vertical line from start
    draw.path_vertical_line(100,
                            relative = True)
    # set starting point for second sub-path
    draw.path_move(to =(190, 10))
    # Drawing vertical line from start
    draw.path_vertical_line(100,
                            relative = True)
    draw.path_finish()
    with Image(width = 200, height = 200, background = Color('lightgreen')) as image:
        draw(image)
        image.save(filename ="pathmove.png")


Output :


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads