PHP | ImagickDraw pathStart() Function Last Updated : 30 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::pathStart() function is an inbuilt function in PHP which is used to declare the start of a path drawing list. Later, pathFinish() function is used to terminate this list. Syntax: bool ImagickDraw::pathStart( void ) Parameters: This function doesn’t accept any parameters. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the ImagickDraw::pathStart() function in PHP: Program 1: php <?php // Create a new Imagick object $imagick = new Imagick(); // Create a image on Imagick object $imagick->newImage(800, 250, 'white'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the stroke width $draw->setStrokeWidth(10); $draw->setFillColor('green'); // Start the path $draw->pathStart(); // Draw a pattern $draw->pathMoveToRelative(400, 200); $draw->pathLineToAbsolute(400, 100); $draw->pathLineToAbsolute(300, 200); $draw->pathLineToAbsolute(300, 100); // End the path $draw->pathFinish(); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'white'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the stroke width $draw->setStrokeWidth(10); // Set the stroke color $draw->setStrokeColor('red'); // Set the fill color $draw->setFillColor('white'); // Start the path $draw->pathStart(); $x = 1; // Draw a pattern while ($x < 10) { $draw->pathMoveToAbsolute($x * 100, 0); $draw->pathLineToHorizontalAbsolute($x * 100); $draw->pathMoveToAbsolute(0, $x * 100); $x++; } $draw->pathclose(); // End the path $draw->pathFinish(); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.pathstart.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw pop() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickDraw pathClose() Function The ImagickDraw::pathClose() function is an inbuilt function in PHP which is used to add a path element to the current path which closes the current subpath by drawing a straight line. In simple words, it is used to completely apply a stroke to all the edges. Syntax: bool ImagickDraw::pathClose( voi 2 min read PHP | ImagickDraw pathFinish() Function The ImagickDraw::pathFinish() function is an inbuilt function in PHP which is used to terminate the current path. This is required when multiple paths are to be drawn in the image. Syntax: bool ImagickDraw::pathFinish( void ) Parameters: This function doesnât accepts any parameter. Return Value: Thi 2 min read PHP | ImagickDraw pop() Function The ImagickDraw::pop() function is an inbuilt function in PHP which is used to destroy the current ImagickDraw in the stack and returns the previously pushed ImagickDraw. For every pop() function there must have already been an equivalent push() function. Syntax: bool ImagickDraw::pop( void ) Parame 2 min read PHP | ImagickDraw pathMoveToAbsolute() Function The ImagickDraw::pathMoveToAbsolute() function is an inbuilt function in PHP which is used to start a new sub-path at the given coordinate using absolute coordinates. The current point then becomes the specified coordinate. This function is used for setting initial coordinates before starting drawin 2 min read PHP | ImagickDraw pathMoveToRelative() Function The ImagickDraw::pathMoveToRelative() function is an inbuilt function in PHP which is used to start a new sub-path at the given coordinate using relative coordinates. The current point then becomes the specified coordinate. This function is used for setting initial coordinates before starting drawin 2 min read PHP | ImagickDraw pathLineToAbsolute() Function The ImagickDraw::pathLineToAbsolute() function is an inbuilt function in PHP which is used to draw a line path from the current point to the given coordinate using absolute coordinates. The coordinate then becomes the new current point. The initial point can be set using pathMoveToAbsolute() functio 2 min read Like