public function drawEllipse($x, $y, $w, $h = null)
{
$wid = $w * 2;
$hgt = (null === $h ? $w : $h) * 2;
// Create an image resource.
$this->createResource();
// Create stroke, if applicable.
if (null !== $this->strokeColor) {
$stroke = $this->setColor($this->strokeColor);
if (null === $this->strokeWidth) {
$this->strokeWidth = 1;
}
imagefilledellipse($this->resource, $x, $y, $wid + $this->strokeWidth, $hgt + $this->strokeWidth, $stroke);
}
// Set fill color and create ellipse.
if (null === $this->fillColor && null === $this->backgroundColor) {
$fill = $this->setColor(new Rgb(255, 255, 255));
} else {
if (null === $this->fillColor) {
$fill = $this->setColor($this->backgroundColor);
} else {
$fill = $this->setColor($this->fillColor);
}
}
imagefilledellipse($this->resource, $x, $y, $wid, $hgt, $fill);
$this->output = $this->resource;
return $this;
}