<?php
namespace Intervention\Image\Gd\Shapes;
use Intervention\Image\AbstractShape;
use Intervention\Image\Gd\Color;
use Intervention\Image\Image;
class PolygonShape extends AbstractShape
{
/**
* Array of points of polygon
*
* @var int
*/
public $points;
/**
* Create new polygon instance
*
* @param array $points
*/
public function __construct($points)
{
$this->points = $points;
}
/**
* Draw polygon on given image
*
* @param Image $image
* @param int $x
* @param int $y
* @return boolean
*/
public function applyToImage(Image $image, $x = 0, $y = 0)
{
$background = new Color($this->background);
imagefilledpolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $background->getInt());
if ($this->hasBorder()) {
$border_color = new Color($this->border_color);
imagesetthickness($image->getCore(), $this->border_width);
imagepolygon($image->getCore(), $this->points, intval(count($this->points) / 2), $border_color->getInt());
}
return true;
}
}
How To Payment
Making a payment on our website is quick and secure. Start by logging in or creating an account. Select your preferred payment method, input the required details, and review the information. Once you confirm everything is correct, click on the "Submit Payment" button. You’ll receive instant confirmation and can track your payment status through your account dashboard. It’s an easy and secure process.