PHP | ImagickDraw destroy() Function Last Updated : 19 Dec, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The ImagickDraw::destroy() function is an inbuilt function in PHP which is used to free all resources associated with the ImagickDraw object. Syntax: bool ImagickDraw::destroy( void ) Parameters: This function doesn’t accepts any parameter. Return Value: This function returns TRUE on success. Exceptions: This function throws ImagickException on error. Below programs illustrate the ImagickDraw::destroy() function in PHP: Program 1: php <?php // Create a new ImagickDraw object $draw = new ImagickDraw(); // Draw a circle $draw->circle(10, 20, 600, 200); // Draw a line $draw->line(10, 20, 600, 200); echo 'Before destroying:<br>'; echo $draw->getVectorGraphics(); // Destroy object $draw->destroy(); echo '<br>After destroying:<br>'; echo $draw->getVectorGraphics(); ?> Output: Before destroying: UndefinedNone#0000000000001Evenodd12UndefinedUndefined0Undefined#FFFFFFFFFFFFFFFF10ButtMiter1001Undefined1#000000000000FFFFcircle 10 20 600 200 line 10 20 600 200 After destroying: UndefinedNone#0000000000001Evenodd12UndefinedUndefined0Undefined#FFFFFFFFFFFFFFFF10ButtMiter1001Undefined1#000000000000FFFF Program 2: php <?php // Create a new imagick object $imagick = new Imagick(); // Create a image on imagick object $imagick->newImage(800, 250, 'white'); // Create a new ImagickDraw object $draw = new ImagickDraw(); // Draw a line $draw->line(10, 20, 600, 200); // Render the draw commands $imagick->drawImage($draw); // Destroy object after drawing $draw->destroy(); // Show the output $imagick->setImageFormat('png'); header("Content-Type: image/png"); echo $imagick->getImageBlob(); ?> Output: Reference: https://www.php.net/manual/en/imagickdraw.destroy.php Comment More infoAdvertise with us Next Article PHP | ImagickDraw clear() Function G gurrrung Follow Improve Article Tags : Web Technologies PHP PHP-function PHP-Imagick Similar Reads PHP | Imagick destroy() Function The Imagick::destroy() function is an inbuilt function in PHP which is used to destroy the Imagick object and free all the resources associated with it. You can't access your object content once it is destroyed. Syntax: bool Imagick::destroy( void ) Parameters: This function does not accept any para 1 min read PHP | Gmagick destroy() Function The Gmagick::destroy() function is an inbuilt function in PHP which is used to destroy the Gmagick object and frees all resources associated with it. Syntax: bool Gmagick::destroy( void ) Parameters: This function doesnât accept any parameter. Return Value: This function returns TRUE on success. Exc 1 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 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 | 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 | ImagickDraw color() Function The ImagickDraw::color() function is an inbuilt function in PHP which is used to draw color on the image using the current fill color, starting at the specified position, and using specified paint method. Syntax: bool ImagickDraw::color( float $x, float $y, int $paintMethod ) Parameters: This functi 2 min read Like