Horde_Image_Imagick::circle PHP Method

circle() public method

Draws a circle.
public circle ( integer $x, integer $y, integer $r, string $color, string $fill = 'none' )
$x integer The x coordinate of the centre.
$y integer The y coordinate of the centre.
$r integer The radius of the circle.
$color string The line color of the circle.
$fill string The color to fill the circle.
    public function circle($x, $y, $r, $color, $fill = 'none')
    {
        try {
            $draw = new ImagickDraw();
            $draw->setFillColor(new ImagickPixel($fill));
            $draw->setStrokeColor(new ImagickPixel($color));
            $draw->circle($x, $y, $r + $x, $y);
        } catch (ImagickDrawException $e) {
            throw new Horde_Image_Exception($e);
        } catch (ImagickPixelException $e) {
            throw new Horde_Image_Exception($e);
        }
        try {
            $this->_imagick->drawImage($draw);
        } catch (ImagickException $e) {
            throw new Horde_Image_Exception($e);
        }
        $draw->destroy();
    }