PHP | ImagickDraw setStrokeDashOffset() Function Last Updated : 20 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::setStrokeDashOffset() function is an inbuilt function in PHP which is used to set the offset into the dash pattern to start the dash. Syntax: bool ImagickDraw::setStrokeDashOffset( float $dash_offset ) Parameters: This function accepts a single parameter $dash_offset which holds the dash offset. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the ImagickDraw::setStrokeDashOffset() function in PHP: Program 1: php <?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the stroke dash offset $draw->setStrokeDashOffset(5); // Get the stroke dash offset $offset = $draw->getStrokeDashOffset(); echo $offset; ?> Output: 5 Program 2: php <?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // 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(); // Set the fill color $draw->setFillColor('black'); // Set the color of stroke $draw->setStrokeColor('white'); // Set the stroke dash array $draw->setStrokeDashArray([15, 5, 15]); // Set the stroke dash offset $draw->setStrokeDashOffset(20); // Draw a circle using ellipse function $draw->ellipse(400, 100, 70, 70, 60, 900); // 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.setstrokedashoffset.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw setStrokeWidth() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | ImagickDraw setStrokeWidth() Function The ImagickDraw::setStrokeWidth() function is an inbuilt function in PHP which is used to set the width of the stroke used to draw object outlines. Syntax: bool ImagickDraw::setStrokeWidth( $stroke_width ) Parameters: This function accepts a single parameter $stroke_width which is used to hold the v 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 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 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 setStrokeColor() Function The ImagickDraw::setStrokeColor() function is an inbuilt function in PHP which is used to set the color used for stroking object outlines. Syntax: bool ImagickDraw::setStrokeColor( $stroke_pixel ) Parameters: This function accepts a single parameter $stroke_pixel which is used to hold the color valu 2 min read PHP | GmagickDraw setstrokewidth() Function The GmagickDraw::setstrokewidth() function is an inbuilt function in PHP which is used to set the width of the stroke used to draw object outlines. Syntax: public GmagickDraw::setstrokewidth( $stroke_width ) : GmagickDraw Parameters: This function accepts single parameter $stroke_width which is used 2 min read Like