Wand path_start() function in Python
Last Updated :
11 May, 2020
We can also draw paths in wand.drawing
module. Each path method expects a destination point, and will draw from the current point to the new point. The destination point will become the new current point for the next applied path method. Paths in wand consist of some other methods to draw different graphics in a path.
In this article we will learn path_start() function. path is initiated using path_start function.
Syntax: wand.drawing.path_start()
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.path_start()
draw.path_move(to = ( 100 , 100 ))
draw.path_horizontal_line( 1 )
draw.path_close()
draw.path_finish()
with Image(width = 200 ,
height = 200 ,
background = Color( 'green' )) as image:
draw(image)
image.save(filename = "pathstart.png" )
|
Output:
Example #2:
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.path_start()
draw.path_move(to = ( 100 , 100 ))
draw.path_vertical_line( 1 )
draw.path_close()
draw.path_finish()
with Image(width = 200 ,
height = 200 ,
background = Color( 'green' )) as image:
draw(image)
image.save(filename = "pathstart.png" )
|
Output:
Share your thoughts in the comments
Please Login to comment...