public function create($width = null, $height = null)
    {
        $this->width  = ($width)  ? $width : $this->width;
        $this->height = ($height) ? $height : $this->height;

        $imageType    = $this->getImageType();
        $createFunc   = ($imageType === 'gif') ? 'imagecreate' : 'imagecreatetruecolor';
        $this->image  = $createFunc($this->width, $this->height);

        $bgColor = $this->backgroundColor;

        $backgroundColor = imagecolorallocate($this->image, $bgColor[0], $bgColor[1], $bgColor[2]);

        imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $backgroundColor);

        $this->drawText();

        if ($this->drawBorder)
        {
            $this->drawBorder();
        }

        if ($this->drawLine)
        {
            $this->drawLine();
        }

        if ($this->drawPixel)
        {
            $this->drawPixel();
        }

        return $this;
    }
public function create($width = null, $height = null)
    {
        $this->width  = ($width)  ? $width : $this->width;
        $this->height = ($height) ? $height : $this->height;

        $imageType    = $this->getImageType();
        $createFunc   = ($imageType === 'gif') ? 'imagecreate' : 'imagecreatetruecolor';
        $this->image  = $createFunc($this->width, $this->height);

        $bgColor = $this->backgroundColor;

        $backgroundColor = imagecolorallocate($this->image, $bgColor[0], $bgColor[1], $bgColor[2]);

        imagefilledrectangle($this->image, 0, 0, $this->width, $this->height, $backgroundColor);

        $this->drawText();

        if ($this->drawBorder)
        {
            $this->drawBorder();
        }

        if ($this->drawLine)
        {
            $this->drawLine();
        }

        if ($this->drawPixel)
        {
            $this->drawPixel();
        }

        return $this;
    }
public function create ( $ width = null , $ height = null ) { $ this -> width = ( $ width ) ? $ width : $ this -> width ; $ this -> height = ( $ height ) ? $ height : $ this -> height ; $ imageType = $ this -> getImageType ( ) ; $ createFunc = ( $ imageType === 'gif' ) ? 'imagecreate' : 'imagecreatetruecolor' ; $ this -> image = $ createFunc ( $ this -> width , $ this -> height ) ; $ bgColor = $ this -> backgroundColor ; $ backgroundColor = imagecolorallocate ( $ this -> image , $ bgColor [ 0 ] , $ bgColor [ 1 ] , $ bgColor [ 2 ] ) ; imagefilledrectangle ( $ this -> image , 0 , 0 , $ this -> width , $ this -> height , $ backgroundColor ) ; $ this -> drawText ( ) ; if ( $ this -> drawBorder ) { $ this -> drawBorder ( ) ; } if ( $ this -> drawLine ) { $ this -> drawLine ( ) ; } if ( $ this -> drawPixel ) { $ this -> drawPixel ( ) ; } return $ this ; }
Captcha image creator

@param int $width null
@param int $height null
@return $this
Captcha image creator