PHP | GmagickDraw annotate() Function Last Updated : 21 Jan, 2020 Comments Improve Suggest changes Like Article Like Report The GmagickDraw::annotate() function is an inbuilt function in PHP which is used to draw the text on the image. Syntax: GmagickDraw GmagickDraw::annotate( float $x, float $y, string $text ) Parameters: This function accept three parameters as mentioned above and described below: $x: It specifies the x-coordinate of the text. $y: It specifies the y-coordinate of the text. $text: It specifies the text content. Return Value: This function returns GmagickDraw object on success. Exceptions: This function throws GmagickException on error. Below given programs illustrate the GmagickDraw::annotate() function in PHP: Used Image: Program 1 (Adding text to a drawing): php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the color $draw->setFillColor('white'); // Function to draw rectangle $draw->rectangle(0, 0, 800, 400); // Set the fill color $draw->setFillColor('red'); // Set the font size $draw->setfontsize(80); // Annotate a text $draw->annotate(30, 120, 'GeeksforGeeks'); // Use of drawimage function $gmagick->drawImage($draw); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Program 2 (Adding text to a image): php <?php // Create a new Gmagick object $gmagick = new Gmagick('geeksforgeeks.png'); // Create a GmagickDraw object $draw = new GmagickDraw(); // Set the fill color $draw->setFillColor('green'); // Set the font size $draw->setfontsize(30); // Annotate a text $draw->annotate(100, 120, 'This line is drawn with annotate'); // Use of drawimage function $gmagick->drawImage($draw); // Display the output image header("Content-Type: image/png"); echo $gmagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/gmagickdraw.annotate.php Comment More infoAdvertise with us Next Article PHP | GmagickDraw annotate() Function gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Gmagick Similar Reads PHP | ImagickDraw annotation() Function The ImagickDraw::annotation() function is an inbuilt function in PHP which is used to draw the text on the image. Syntax: bool ImagickDraw::annotation( $x, $y, $text ) Parameters: This function accepts three parameters as mentioned above and described below: $x: This parameter is used to hold the va 3 min read PHP | Gmagick annotateImage() Function The Gmagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: Gmagick Gmagick::annotateimage( $GmagickDraw, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above 2 min read PHP | GmagickDraw arc() Function The GmagickDraw::arc() function is an inbuilt function in PHP which is used to draw an arc falling within a specified bounding rectangle on the image. Syntax:  GmagickDraw GmagickDraw::arc( float $sx, float $sy, float $ex, float $ey, float $sd, float $ed ) Parameters: This function accept six parame 2 min read PHP | Imagick annotateImage() Function The Imagick::annotateImage() function is an inbuilt function in PHP which is used to annotates an image with text. This function returns True on success. Syntax: bool Imagick::annotateImage( $draw_settings, $x, $y, $angle, $text ) Parameters: This function accepts five parameters as mentioned above 2 min read PHP | ImagickDraw clone() Function The ImagickDraw::clone() function is an inbuilt function in PHP which is used to make an exact copy of the specified ImagickDraw object. Syntax: ImagickDraw ImagickDraw::clone( void ) Parameters: This function doesnât accepts any parameter. Return Value: This function returns the exact copy of the s 2 min read PHP | GmagickDraw bezier() Function The GmagickDraw::bezier() function is an inbuilt function in PHP which is used to draw bezier curve. Syntax: GmagickDraw GmagickDraw::bezier( array $coordinate_array ) Parameters: This function accepts a single parameter $coordinate_array which holds the multidimensional array which takes the points 2 min read PHP | ImagickDraw __construct() Function The ImagickDraw::__construct() function is an inbuilt function in PHP which is used to initialize a ImagickDraw object. Syntax: bool ImagickDraw::__construct( void ) Parameters: This function doesnât accept any parameter. Return Value: This function returns TRUE on success. Exceptions: This function 1 min read PHP | GmagickDraw ellipse() function The GmagickDraw::ellipse() function is an inbuilt function in PHP which is used to draw an ellipse on the image. Syntax: GmagickDraw GmagickDraw::ellipse( float $ox, float $oy, float $rx, float $ry, float $start, float $end ) Parameters: This function accepts six parameters as mentioned above and de 2 min read PHP | ImagickDraw comment() Function The ImagickDraw::comment() function is an inbuilt function in PHP which is used to add a comment to a vector output stream. The comment is appended at the end of the output stream. Syntax: bool ImagickDraw::comment( string $comment ) Parameters: This function accept a single parameter $comment which 2 min read PHP | ImagickDraw clear() Function The ImagickDraw::clear() function is an inbuilt function in PHP which is used to clear the ImagickDraw object of any accumulated commands, and resets the settings it contains to their defaults. Syntax: bool ImagickDraw::clear( void ) Parameters: This function doesnât accepts any parameter. Return Va 2 min read Like