PHP | GmagickDraw getstrokecolor() Function Last Updated : 23 Jan, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report The GmagickDraw::getstrokecolor() function is an inbuilt function in PHP which is used to get the color used for stroking object outlines. Syntax: ImagickPixel GmagickDraw::getstrokecolor( void ) Parameters: This function doesn’t accept any parameters. Return Value: This function returns an GmagickPixel value containing the color. Exceptions: This function throws GmagickDrawException on error. Below given programs illustrate the GmagickDraw::getstrokecolor() function in PHP: Program 1: php <?php // Create a new GmagickDraw object $draw = new GmagickDraw(); // Get the stroke color $strokeColor = $draw->getstrokecolor()->getcolor(); echo $strokeColor; ?> Output: rgb(0, 0, 0) Program 2: php <?php // Create a new GmagickDraw object $draw = new GmagickDraw(); // Set the stroke color $draw->setstrokecolor('#4a76bd'); // Get the stroke color $strokeColor = $draw->getstrokecolor()->getcolor(); echo $strokeColor; ?> Output: rgb(19018, 30326, 48573) Used Image: Program 3: php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the color $draw->setFillColor('#0E0E0E'); // Draw rectangle for background $draw->rectangle(-10, -10, 800, 400); // Set the fill color $draw->setFillColor('white'); // Set the color of stroke $draw->setStrokeColor('red'); // Set the width of stroke $draw->setstrokewidth(1); // Set the font size $draw->setFontSize(20); // Get the stroke color $strokecolor = $draw->getstrokecolor()->getcolor(); // Annotate a text $draw->annotate(50, 100, 'The stroke color here is ' . $strokecolor); // Use of drawimage functeannotate $gmagick->drawImage($draw); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/gmagickdraw.getstrokecolor.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw getstrokeopacity() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Gmagick Similar Reads PHP | ImagickDraw getStrokeColor() Function The ImagickDraw::getStrokeColor() function is an inbuilt function in PHP which is used to get the color used for stroking object outlines. Syntax: ImagickPixel ImagickDraw::getStrokeColor( void ) Parameters: This function doesnât accepts any parameters. Return Value: This function returns ImagickPix 2 min read PHP | GmagickDraw getstrokeopacity() Function The Gmagick::getstrokeopacity() function is an inbuilt function in PHP which is used to return the opacity of stroked object outlines. Syntax: public GmagickDraw::getstrokeopacity( void ) Â Parameters: This function does not accept any parameter. Return Value: This function returns the double descri 2 min read PHP | GmagickDraw getstrokewidth() Function The Gmagick::getstrokewidth() function is an inbuilt function in PHP which is used to return the width of the stroke used to draw object outlines. Syntax: public GmagickDraw::getstrokewidth( void ) Â Parameters: This function does not accept any parameter. Return Value: This function returns a doubl 1 min read PHP | GmagickDraw getfillcolor() function The GmagickDraw::getfillcolor() function is an inbuilt function in PHP which is used to get the fill color used for drawing filled objects. Syntax: GmagickPixel GmagickDraw::getfillcolor( void ) Parameters:This function doesnât accept any parameter. Return Value: This function returns GmagickPixel f 2 min read PHP | ImagickDraw getStrokeOpacity() Function The ImagickDraw::getStrokeOpacity() function is an inbuilt function in PHP which is used to return the opacity of stroked object outlines. Syntax: float ImagickDraw::getStrokeOpacity( void ) Parameters: This function does not accepts any parameters. Return Value: This function returns stroke opacity 1 min read PHP | ImagickDraw getStrokeWidth() Function The ImagickDraw::getStrokeWidth() function is an inbuilt function of PHP which is used to return the width of the stroke used to draw object outlines. Syntax: float ImagickDraw::getStrokeWidth( void ) Parameters: This function does not accept any parameters. Return Value: This function returns strok 1 min read Like