PHP ImagickDraw function setStrokeOpacity ()

PHP

Syntax:
bool ImagickDraw::setStrokeOpacity ($stroke_opacity)
Parameters: This function takes one parameter, $stroke_opacity, which is used to store the opacity value of the stroke as a floating point type.Return Value:This function does not return no value.The programs below illustrate the ImagickDraw::setStrokeOpacity() functionin PHP:Program 1:  
// require_once (' path / vendor / autoload.php '); 
// Create an ImagickDraw object for drawing. $draw = new ImagickDraw();  
// Set stroke color $draw -> setStrokeColor ( 'Green' );  
// Set fill color $draw -> setFillColor ( 'Red' );  
// Set the opacity of the stroke $draw -> setStrokeOpacity (0.5);  
// Set the stroke width $draw -> setStrokeWidth (9);  
// Draw a rectangle $draw -> rectangle (40, 30, 200, 260);  
// Create a new imagick object $image = new Imagick();  
// Create a new image of the specified size $image -> newImage (240, 300, 'White' );  
// Set image format $image -> setImageFormat ( "png" );  
// Draw image $image -> drawImage ( $draw ); header ( " Content-Type: image / png " );  
// Display the output 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 color $draw -> setStrokeColor ( 'Black' );  
// Set the opacity of the stroke $draw -> setStrokeOpacity (0.6);  
// Set the stroke width $draw -> setStrokeWidth (4);  
// Set fill color $draw -> setFillColor ( 'lightgreen' ); $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: Link: http://php.net/manual/en/imagickdraw.setstrokeopacity.php