📜  PHP | Gmagick flopimage()函数

📅  最后修改于: 2022-05-13 01:56:34.573000             🧑  作者: Mango

PHP | Gmagick flopimage()函数

Gmagick::flopimage()函数是PHP中的一个内置函数,用于创建失败的图像。此函数沿 y 轴创建镜像。

句法:

Gmagick Gmagick::flopimage( void )


参数:此函数不接受任何参数。

返回值:此函数返回失败的 Gmagick 对象。

错误/异常:此函数在错误时抛出 GmagickException。

下面的程序说明了PHP中的Gmagick::flopimage()函数:

方案一:
原图:

flopimage();
  
header('Content-type: image/png'); 
    
// Output the image 
echo $gmagick; 
?> 

输出:

方案二:

setStrokeOpacity(1); 
$draw->setStrokeColor('Red'); 
$draw->setFillColor('Green'); 
    
// Set the width and height of image 
$draw->setStrokeWidth(7); 
$draw->setFontSize(72); 
   
// Function to draw circle  
$draw->circle(250, 250, 100, 150); 
  
$gmagick = new Gmagick(); 
$gmagick->newImage(500, 500, 'White'); 
$gmagick->annotateimage ( $draw , 50 , 60, 54 , 'GeeksForGeeks');
$gmagick->setImageFormat("png"); 
$gmagick->drawImage($draw); 
  
    
// Use flopimage() function 
$gmagick->flopimage();
  
// Display the output image 
header("Content-Type: image/png"); 
echo $gmagick->getImageBlob(); 
?> 

输出:

参考: http: PHP。 PHP