PHP ImagickDraw function setStrokeMiterLimit ()

PHP

Syntax:
bool ImagickDraw::setStrokeMiterLimit ($miterlimit)
Parameters: This function takes one parameter $miterlimit which is used to store the value of the miterlimit as an integer type.Return Value:This function does not return any value .The following programs illustrate the ImagickDraw::setStrokeMiterLimit()function in PHP:Program 1:  
// require_once (` path / vendor / autoload.php `);  // Create an ImagickDraw object $draw = new ImagickDraw();  
// Set the opacity of the stroke $draw -> setStrokeOpacity (1);  
// Set the stroke color $draw -> setStrokeColor ( `Black` );  
// Set the opacity of the stroke $draw -> setStrokeOpacity (0.6);  
// Set the stroke width $draw -> setStrokeWidth (4);  
// Set the fill color of the image $draw -> setFillColor ( `lightgreen` );  
// Set the miter travel limit $draw -> setStrokeMiterLimit (40 * 12); $points = [ [ `x` = > 50 * 6, `y` = > 10 * 5], [ `x` = > 20 * 7, `y` = > 30 * 5], [ `x` = > 60 * 8, `y` = > 50 * 5], [ `x` = > 70 * 3, `y` = > 15 * 5], ];  
// Draw a polygon $draw -> polygon ( $points );  
// Create a new Imagick object $image = new Imagick();  
// Set image dimensions $image -> newImage (500, 300, `white` );  
// Set image format $image -> setImageFormat ( "png" );  
// Draw image $image -> drawImage ( $draw ); header ( "Content-Type: image / png" );  
// Show image echo $image -> getImageBlob(); ?>
Output: Program 2:  
// require_once (` path / vendor / autoload.php `); 
// Create an ImagickDraw object for drawing. $draw = new ImagickDraw();  
// Set the stroke width $draw -> setStrokeWidth (5);  
// Set the miter travel limit $draw -> setStrokeMiterLimit (50 * 15);  
// Set the stroke color $draw -> setStrokeColor ( `black` );  
// Set the fill color of the image $draw -> setFillColor ( `red` ); $points = [[ `x ` = > 40 * 5, `y` = > 10 * 5], [ `x` = > 70 * 5, `y` = > 50 * 5], [ `x` = > 60 * 5, `y` = > 15 * 5],];  
// Draw a polygon $draw -> polygon ( $points );  
// Set the fill color of the image $draw -> setFillColor ( `green` );  
// Set translation points $draw -> translate (10, 30); $points = [[ `x ` = > 40 * 5, `y` = > 10 * 5], [ `x` = > 70 * 5, `y` = > 50 * 5], [ `x` = > 60 * 5, `y` = > 15 * 5],];  
// Draw a polygon $draw -> polygon ( $points );  
// Set the fill color of the image $draw -> setFillColor ( `blue` );  
// Set translation points $draw -> translate (10, 30); $points = [[ `x ` = > 40 * 5, `y` = > 10 * 5], [ `x` = > 70 * 5, `y` = > 50 * 5], [ `x` = > 60 * 5, `y` = > 15 * 5],];  
// Draw a polygon $draw -> polygon ( $points );  
// Set the fill color of the image $draw -> setFillColor ( `yellow` );  
// Set translation points $draw -> translate (10, 30); $points = [[ `x ` = > 40 * 5, `y` = > 10 * 5], [ `x` = > 70 * 5, `y` = > 50 * 5], [ `x` = > 60 * 5, `y` = > 15 * 5],];  
// Draw a polygon $draw -> polygon ( $points );  
// Create a new Imagick object $image = new Imagick();  
// Set image dimensions $image -> newImage (400, 400, `white` );  
// Set image format $image -> setImageFormat ( "png" );  
// Draw image $image -> drawImage ( $draw ); header ( "Content-Type: image / png" );  
// Show image echo $image -> getImageBlob(); ?>
Output: Link: http://php.net/manual/en/imagickdraw.setstrokemiterlimit.php



Get Solution for free from DataCamp guru