利用Imagick画一朵鲜花

<?php
 
/**
  * 利用Imagick画一朵鲜花
  * @author :Refer Con www.phpcq.com
  * 由于时间问题,没写注释,请见谅!
  */
class Flower extends ImagickDraw
{
    private 
$ImagickPixel;
 
    public function 
__construct()
    {
        
$this->ImagickPixel = new ImagickPixel();
    }
 
    public function 
drawFlower()
    {
        
$this->createStraw();
        
$this->createPetals();
        
$this->createLeafs();
    }
 
    private function 
createPetals()
    {
        
$this->ImagickPixel->setColorred );
        
$this->setFillColor$this->ImagickPixel );
 
        
$this->ImagickPixel->setColorblack );
        
$this->setStrokeColor$this->ImagickPixel );
        
$this->setStrokeWidth0.5 );
 
        
$this->circle409070110 );
        
$this->circle855011570 );
        
$this->circle12590155110 );
        
$this->circle85130115150 );
 
        
$this->ImagickPixel->setColorwhite );
        
$this->setFillColor$this->ImagickPixel );
 
        
$this->circle8590115110 );
    }
 
    private function 
createStraw()
    {
        
$this->ImagickPixel->setColortransparent );
        
$this->setFillColor$this->ImagickPixel );
 
        
$this->ImagickPixel->setColorgreen );
        
$this->setStrokeColor$this->ImagickPixel );
        
$this->setStrokeWidth);
 
        
$this->bezier( array(
                             array( 
=> 85=> 150 ),
                             array( 
=> 105=> 190 ),
                             array( 
=> 55=> 400 ),
                             array( 
=> 75=> 500 ),
                             )
                      );
    }
 
    private function 
createLeafs()
    {
        
$this->ImagickPixel->setColorgreen );
        
$this->setFillColor$this->ImagickPixel );
        
$this->setStrokeColor$this->ImagickPixel );
 
        
$this->bezier( array(
                             array( 
=> 75=> 370 ),
                             array( 
=> 65=> 250 ),
                             array( 
=> 25=> 270 ),
                             array( 
=> 15=> 290 ),
                             array( 
=> 25=> 310 ),
                             array( 
=> 35=> 330 ),
                             array( 
=> 55=> 350 ),
                             )
                      );
 
        
$this->bezier( array(
                             array( 
=> 75=> 365 ),
                             array( 
=> 95=> 250 ),
                             array( 
=> 135=> 270 ),
                             array( 
=> 145=> 280 ),
                             array( 
=> 145=> 290 ),
                             array( 
=> 135=> 310 ),
                             array( 
=> 125=> 320 ),
                            )
                     );
    }
}
 
$Flower = new Flower();
$Flower->drawFlower();
 
$Imagick = new Imagick();
$Imagick->newPseudoImage175500"gradient:pink-white\\\" );
$Imagick->setImageFormat( \\\'png\\\' );
 
$Imagick->drawImage( $Flower );
 
header( \\\"Content-Type: image/{$Imagick->getImageFormat()}\\\" );
echo $Imagick;
       
      

上一篇文章: Imagick实现图片偏振 下一篇文章: Imagick分析图像属性

关于PHP博客

PHP blogger

博客-致力于分享PHP技术的开发心得, 记录站长生活的点点滴滴,PHP博客采用PHP 面向对象编程+Smarty模板引擎+Mysql数据库 开发(全站纯静态化与伪静态化)
QQ:334192009
电邮:admin@PHPdesigner.org

本站搜索

本站最新文章

博客最近档案

友情链接