PHP | ImagickDraw setStrokePatternURL() Function Last Updated : 20 Feb, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::setStrokePatternURL() function is an inbuilt function in PHP which is used to set the pattern used for stroking object outlines. Syntax: bool ImagickDraw::setStrokePatternURL( string $stroke_url ) Parameters:This function accepts a single parameter $stroke_url which holds the URL of stroke pattern. Return Value: This function returns TRUE on success. Below given programs illustrate the ImagickDraw::setStrokePatternURL() function in PHP: Program 1: In this program we will create a rectangle with designed outline. php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'black'); // Create a new imagickDraw object $draw = new ImagickDraw(); // Push the pattern $draw->pushPattern("MyPattern", 0, 0, 50, 50); $color = ['red', 'black', 'cyan']; for ($x = 0; $x < 50; $x += 10) { for ($y = 0; $y < 50; $y += 5) { $draw->setFillColor($color[$y % 3]); $draw->circle($x, $y + 80, $x % 2, $y); } } // Pop the pattern $draw->popPattern(); // Set the stroke pattern URL $draw->setStrokePatternURL('#MyPattern'); // Set the stroke width $draw->setStrokeWidth(10); // Draw a rectangle on which pattern is made $draw->rectangle(200, 50, 500, 200); // Render the draw commands $imagick->drawImage($draw); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Program 2: In this program we will create a circle with designed outline. 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(); // Push the pattern $draw->pushPattern("MyPattern", 0, 0, 50, 50); for ($x = 0; $x < 50; $x += 10) { for ($y = 0; $y < 50; $y += 5) { $draw->setFillColor('green'); $draw->rectangle($x, $y + 10, $x % 5, $y); } } // Pop the pattern $draw->popPattern(); // Set the stroke pattern URL $draw->setStrokePatternURL('#MyPattern'); // Set the stroke width $draw->setStrokeWidth(10); // Draw a circle $draw->circle(300, 100, 350, 20); // 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.setstrokepatternurl.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw setStrokeOpacity() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Gmagick Similar Reads PHP | ImagickDraw setFillPatternURL() Function The ImagickDraw::setFillPatternURL() function is an inbuilt function in PHP which is used to set the URL to use as a fill pattern for filling objects. The URL actually is a unique name of a pattern with a '#' before the name. Syntax: bool ImagickDraw::setFillPatternURL( string $fill_url ) Parameters 2 min read PHP | ImagickDraw setStrokeOpacity() Function The ImagickDraw::setStrokeOpacity() function is an inbuilt function in PHP which is used to specify the opacity of stroked object outlines. The value of opacity lies between 0 to 1. Syntax: bool ImagickDraw::setStrokeOpacity( $stroke_opacity ) Parameters: This function accepts a single parameter $st 2 min read PHP | ImagickDraw setStrokeAlpha() Function The ImagickDraw::setStrokeAlpha() function is an inbuilt function in PHP which is used to specify the opacity of stroked object outlines. Syntax: bool ImagickDraw::setStrokeAlpha( $opacity ) Parameters: This function accepts a single parameter opacity which is used to specify the transparency of str 2 min read PHP | ImagickDraw setStrokeMiterLimit() Function The ImagickDraw::setStrokeMiterLimit() function is an inbuilt function in PHP which is used to specify the miter limit of stroke. When two line segments are meet at a sharp angle and miter joins have been specified for 'lineJoin', it is possible for the miter to extend far beyond the thickness of th 3 min read PHP | ImagickDraw setStrokeAntialias() Function The ImagickDraw::setStrokeAntialias() function is an inbuilt function in PHP which is used to set the current stroke antialias setting. Stroked outlines are antialiased (enabled) by default. Alias is just a noise or distortion in the stroke. Syntax: bool ImagickDraw::setStrokeAntialias( bool $stroke 2 min read PHP | ImagickDraw setStrokeDashArray() Function The ImagickDraw::setStrokeDashArray() function is an inbuilt function in PHP which is used to set the pattern of dashes and gaps used to stroke paths. In case of odd number of values, the list of values is repeated to yield an even number of values. To remove an existing dash array, pass a zero numb 2 min read Like