PHP Imagick getImageDispose () function

PHP

Syntax:
int Imagick::getImageDispose (void)
Parameters:this function takes no parameters.Return value:this function returns the dispose method on success.The following programs illustrate the Imagick::getImageDispose()in PHP:Program 1:
Original Image:
 
// Create a new Imagick object $imagick = new Imagick ( ' https://media.engineerforengineer.org/wp-content/uploads/engineerforengineer-15.png ' );  
// Using the getImageDispose function $res = $imagick -> getImageDispose();  
// Show result echo ( $res ) ; ?>
Output:
0
Program 2:
Original image:
$string = " Computer Science portal for Geeks! " ;  
// Create a new image of the above line // and add color and background $im = new Imagick(); $draw = new ImagickDraw();  
// Fill the color in the image $draw -> setFillColor ( new ImagickPixel ( 'green' ));  
// Set the text font size $draw -> setFontSize (50); $metrix = $im -> queryFontMetrics ( $draw , $string ); $draw -> annotation (0, 40, $string ); $im -> newImage ( $metrix [ 'textWidth' ], $metrix [ 'textHeight' ], new ImagickPixel ( 'white' ));  
// Draw image $im -> drawImage ( $draw ); $im -> setImageFormat ( 'jpeg' ); $im -> setImageDispose (5);  
// Using the getImageDispose function $res = $im -> getImageDispose();  
// Show result echo ( $res ) ;  
?>
Output:
5
Link: http://php.net /manual/en/imagick.getimagedispose.php



Get Solution for free from DataCamp guru