The ImagickDraw::getStrokeLineJoin() function is an inbuilt function in PHP which is used to get the shape to be used at the corners of paths when they are stroked. This usually impacts the outer edges and turns of the stroke.
Syntax:
int ImagickDraw::getStrokeLineJoin( void )
Parameters: This function doesn’t accepts any parameters.
Return Value: This function returns an integer value corresponding to one of LINEJOIN constants.
List of LINEJOIN constants are given below:
- imagick::LINEJOIN_UNDEFINED (0)
- imagick::LINEJOIN_MITER (1)
- imagick::LINEJOIN_ROUND (2)
- imagick::LINEJOIN_BEVEL (3)
Exceptions: This function throws ImagickException on error.
Below programs illustrate the ImagickDraw::getStrokeLineJoin() function in PHP:
Program 1:
<?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Get the stroke line join $lineJoin = $draw->getStrokeLineJoin(); echo $lineJoin; ?> |
Output:
1 // Which corresponds to imagick::LINEJOIN_MITER
Program 2:
<?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the stroke line join $draw->setStrokeLineJoin(3); // Get the stroke line join $lineJoin = $draw->getStrokeLineJoin(); echo $lineJoin; ?> |
Output:
3 // Which corresponds to imagick::LINEJOIN_BEVEL
Program 3:
<?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, 'white'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Set the fill color $draw->setFillColor('white'); // Set the color of stroke $draw->setStrokeColor('blue'); // Set the stroke width $draw->setStrokeWidth(4); // Set the font size $draw->setFontSize(25); // Set the stroke dash array $draw->setStrokeDashArray([20]); // Draw a rectangle $draw->rectangle(100, 50, 225, 175); // Annotate a text $draw->annotation(10, 220, 'The strokeLineJoin here is ' . $draw->getStrokeLineJoin()); // Set the stroke line join $draw->setStrokeLineJoin(2); // Draw a rectangle $draw->rectangle(500, 50, 625, 175); // Annotate a text $draw->annotation(400, 220, 'The strokeLineJoin here is ' . $draw->getStrokeLineJoin()); // 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.getstrokelinejoin.php
Recommended Posts:
- PHP | ImagickDraw getTextAlignment() Function
- PHP | ImagickDraw scale() Function
- PHP | ImagickDraw polygon() Function
- PHP | ImagickDraw roundRectangle() Function
- PHP | ImagickDraw arc() Function
- PHP | ImagickDraw circle() Function
- PHP | ImagickDraw bezier() Function
- PHP | ImagickDraw rectangle() Function
- PHP | ImagickDraw line() Function
- PHP | ImagickDraw point() Function
- PHP | ImagickDraw skewX() Function
- PHP | ImagickDraw setStrokeWidth() Function
- PHP | ImagickDraw translate() Function
- PHP | ImagickDraw setStrokeOpacity() Function
- PHP | ImagickDraw setGravity() Function
- PHP | ImagickDraw setFillColor() Function
- PHP | ImagickDraw setFont() Function
- PHP | ImagickDraw setFontStyle() Function
- PHP | ImagickDraw setFontFamily() Function
- PHP | ImagickDraw setFontSize() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.

