PHP | GmagickDraw roundrectangle() Function Last Updated : 29 Jan, 2019 Comments Improve Suggest changes Like Article Like Report The GmagickDraw::roundrectangle() function is an inbuilt function in PHP which is used to draw a rounded rectangle. Syntax: public GmagickDraw::rectangle( $x1, $y1, $x2, $y2, $rx, $ry) Parameters:This function accepts four parameters as mentioned above and described below: $x1: This parameter takes the value of x coordinate of the top left corner. $y1: This parameter takes the value of y coordinate of the top left corner. $x2: This parameter takes the value of x coordinate of the bottom right. $y2: This parameter takes the value of y coordinate of the bottom right. $ry: This parameter takes the value of radius of corner in vertical direction. $rx: This parameter takes the value of radius of corner in horizontal direction. Return Value: This function returns GmagickDraw object on success. Errors/Exceptions: This function throws GmagickException on error. Below programs illustrate the GmagickDraw::roundrectangle() function in PHP: Program 1: php <?php // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the color $draw->setFillColor('Green'); // Set the width and height of image $draw->setStrokeWidth(7); $draw->setFontSize(72); // Function to draw roundrectangle $draw->roundrectangle(20, 20, 380, 465, 50, 50); $gmagick = new Gmagick(); $gmagick->newImage(500, 500, 'White'); $gmagick->setImageFormat("png"); // Use of drawimage function $gmagick->drawImage($draw); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Program 2: php <?php // Create a GmagickDraw object $draw = new ImagickDraw(); // Set the color $draw->setFillColor('Lightgreen'); // Set the width and height of image $draw->setStrokeWidth(7); $draw->setFontSize(72); // Function to draw roundrectangle $draw->roundrectangle(20, 20, 880, 465, 50, 50); $draw->setFontSize(40); $draw->setFillColor('Green'); $gmagick = new Imagick(); $gmagick->newImage(900, 500, 'White'); $gmagick->setImageFormat("png"); // Use of drawimage function $gmagick->drawImage($draw); // Annotate Image $gmagick->annotateImage($draw, 5, 120, 0, ' GeeksforGeeks: A computer science portal'); $gmagick->annotateImage($draw, 5, 220, 0, ' sarthak_ishu11'); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: http://php.net/manual/en/gmagickdraw.roundrectangle.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw roundrectangle() Function sarthak_ishu11 Follow Improve Article Tags : Web Technologies PHP Image-Processing PHP-function PHP-Gmagick +1 More Similar Reads PHP | ImagickDraw roundRectangle() Function The ImagickDraw::roundRectangle() function is an inbuilt function in Imagick library of PHP which is used to draw a rounded rectangle. Syntax: bool ImagickDraw::roundRectangle( $x1, $y1, $x2, $y2, $rx, $ry ) Parameters: This function accept six parameters as mentioned above and described below: $x1: 2 min read PHP | GmagickDraw rectangle() Function The GmagickDraw::rectangle() function is an inbuilt function in PHP which is used to draw the rectangle. Syntax: public GmagickDraw::rectangle( $x1, $y1, $x2, $y2 )  Parameters:This function accepts four parameters as mentioned above and described below: $x1: This parameter takes the value of x coo 2 min read PHP | ImagickDraw rectangle() Function The ImagickDraw::rectangle() function is an inbuilt function in Imagick library of PHP which is used to draw a rectangle. Syntax: bool ImagickDraw::rectangle( $x1, $y1, $x2, $y2 ) Parameters: This function accepts four parameters as mentioned above and described below: $x1: This parameter takes the 1 min read PHP | GmagickDraw rotate() Function The GmagickDraw::rotate() function is an inbuilt function in PHP which is used to apply the specified rotation to the current coordinate space. Syntax: GmagickDraw GmagickDraw::rotate( array $coordinates_array ) Parameters: This function accepts a single parameter $coordinates_array which is used to 2 min read PHP | ImagickDraw rotate() Function The ImagickDraw::rotate() function is an inbuilt function of PHP which is used to apply the specified rotation to the current coordinate space. bool ImagickDraw::rotate( $degrees ) Parameters: This function accepts a single parameter $degrees which is used to hold the value of degree of rotation. Re 2 min read PHP | GmagickDraw point() Function The GmagickDraw::point() function is an inbuilt function in PHP which is used to draw a point. This function uses current stroke color and stroke thickness at the specified coordinates. Syntax: public GmagickDraw::point( $x, $y )  Parameters:This function accepts two parameters as mentioned above a 2 min read PHP | ImagickDraw scale() Function The ImagickDraw::scale() function is an inbuilt function in PHP which is used to adjust the scaling factor to apply in the horizontal and vertical directions to the current coordinate space. Syntax: bool ImagickDraw::scale( $x, $y ) Parameters: This function accepts two parameter as mentioned above 2 min read PHP | GmagickDraw setfontstyle() Function The GmagickDraw::setfontstyle() function is an inbuilt function in PHP that is used to set the font style to use when annotating with text. Style enumeration acts as a wild-card don't care option. Syntax: public GmagickDraw::setfontstyle( $style ) : GmagickDraw Parameters: This function accepts a s 2 min read PHP | GmagickDraw setfont() function The GmagickDraw::setfont() function is an inbuilt function in PHP which is used to set the fully-specified font to use when annotating with text. Syntax: GmagickDraw GmagickDraw::setfont( string $font ) Parameters:This function accepts a single parameter $font which is used to hold the value of font 1 min read Like