Change language

PHP ImagickDraw function setStrokeAlpha ()

Syntax:
bool ImagickDraw::setStrokeAlpha ($opacity)
Parameters: This function takes opacity one parameter, which is used to specify the transparency of the stroke object. This is a floating point value, it ranges from 0 to 1.Returned value:This function does not return any value.The following programs illustrate function ImagickDraw::setStrokeAlpha()in PHP:Program 1:  
// require_once (’ path / vendor / autoload.php ’); 
// Create Imagick Draw object $draw = new ImagickDraw();  
// Set stroke color $strokeColor = new ImagickPixel ( ’Green’ );  
// Set the fill color $fillColor = new ImagickPixel ( ’Red’ );  
// Set stroke color $draw -> setStrokeColor ( ’Green’ );  
// Set fill color $draw -> setFillColor ( ’Red’ );  
// Set the stroke width $draw -> setStrokeWidth (5);  
// Set the opacity of the stroke $draw -> setStrokeOpacity (0.5); $smoothPointsSet = [ [[ ’x’ = > 10.0 * 5, ’y’ = > 10.0 * 5], [ ’x’ = > 30.0 * 5, ’y’ = > 90.0 * 5], [ ’x’ = > 25.0 * 5, ’y’ = > 10.0 * 5], [ ’x’ = > 50.0 * 5, ’y’ = > 50.0 * 5],] ]; foreach ( $smoothPointsSet as $points ) { $draw -> bezier ( $points ); }  
// Create imagick object $imagick = new Imagick();  
// Set image dimensions $imagick -> newImage (300, 300, ’White’ );  
// Set image format $imagick -> setImageFormat ( "png" );  
// Draw image $imagick -> drawImage ( $draw ); header ( "Content-Type: image / png" );  
// Show image echo $imagick -> getImageBlob(); ?>
Output: Program 2: < tbody>  
// require_once (’ path / vendor / autoload.php ’); 
// Create an ImagickDraw object  $draw = new ImagickDraw();  
// Set the stroke color $draw -> setStrokeColor ( ’Green’ );  
// Set fill color $draw -> setFillColor ( ’Red’ );  
// Set the stroke width $draw -> setStrokeWidth (7);  
// Set the opacity of the stroke $draw -> setStrokeOpacity (0.5);  
// Draw a rectangle-method/">rectangle $draw -> rectangle-method/">rectangle (40, 30, 200, 260);  
// Create an Imagick object $image = new Imagick();  
// Set image dimensions $image -> newImage (250, 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.setstrokealpha.php

Shop

Learn programming in R: courses

$

Best Python online courses for 2022

$

Best laptop for Fortnite

$

Best laptop for Excel

$

Best laptop for Solidworks

$

Best laptop for Roblox

$

Best computer for crypto mining

$

Best laptop for Sims 4

$

Latest questions

NUMPYNUMPY

psycopg2: insert multiple rows with one query

12 answers

NUMPYNUMPY

How to convert Nonetype to int or string?

12 answers

NUMPYNUMPY

How to specify multiple return types using type-hints

12 answers

NUMPYNUMPY

Javascript Error: IPython is not defined in JupyterLab

12 answers


Wiki

Python OpenCV | cv2.putText () method

numpy.arctan2 () in Python

Python | os.path.realpath () method

Python OpenCV | cv2.circle () method

Python OpenCV cv2.cvtColor () method

Python - Move item to the end of the list

time.perf_counter () function in Python

Check if one list is a subset of another in Python

Python os.path.join () method