Horde_Image_Imagick::polygon PHP Method

polygon() public method

Draws a polygon based on a set of vertices.
public polygon ( $verts, string $color, string $fill = 'none' )
$color string The color you want to draw the polygon with.
$fill string The color to fill the polygon.
    public function polygon($verts, $color, $fill = 'none')
    {
        try {
            $draw = new ImagickDraw();
            $draw->setFillColor(new ImagickPixel($fill));
            $draw->setStrokeColor(new ImagickPixel($color));
            $draw->polygon($verts);
        } 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();
    }