PHP ImagickDraw function setTextAntialias ()

PHP

Syntax:
bool ImagickDraw::setTextAntialias ($antiAlias)
Parameters: This function takes one parameter, $antiAlias, which is used to store the logical signal, i.e. E. TRUE / FALSE.Return value :this function does not return any value.The following programs illustrate the ImagickDraw::setTextAntialias()function in PHP:Program 1: < tbody>  
// Create an ImagickDraw object $draw = new ImagickDraw();  
// Set the fill color of the image $draw -> setFillColor ( 'green' );  
// Set font size $draw -> setFontSize (50);  
// Set text anti-aliasing $draw -> setTextAntialias (false);  
// Set text to add $draw -> annotation (50, 75, "Gfg!" );  
// Create a new Imagick object $imagick = new Imagick();  
// Set image dimensions $imagick -> newImage (500, 160, 'black' );  
// Set image format $imagick -> setImageFormat ( "png" );  
// Draw image $imagick -> drawImage ( $draw ); header ( "Content-Type: image / png" );  
// Show image echo $imagick -> getImageBlob(); ?>
Output: Program 2:  
// Create ImagickDraw object $draw = new ImagickDraw();  
// Set the fill color of the image $draw -> setFillColor ( 'orange' );  
// Set font size $draw -> setFontSize (50);  
// Set the TextAntialias function $draw -> setTextAntialias (true);  
// Set text to add $draw -> annotation (5, 75, "Gfg!" );  
// Set the TextAntialias function $draw -> setTextAntialias (false);  
// Set text to add $draw -> annotation (105, 75, "Gfg!" );  
// Create a new Imagick object $imagick = new Imagick();  
// Set image dimensions $imagick -> newImage (300, 160, 'green' );  
// Set image format $imagick -> setImageFormat ( "png" );  
// Draw image $imagick -> drawImage ( $draw ); header ( "Content-Type: image / png" );  
// Show image echo $imagick -> getImageBlob(); ?>
Output: Link: http://php.net/manual/en/imagickdraw.settextantialias.php



Get Solution for free from DataCamp guru