public function drawLine($x1, $y1, $x2, $y2)
{
// Create an image resource and set the stroke color.
$this->createResource();
$strokeWidth = null === $this->strokeWidth ? 1 : $this->strokeWidth;
$strokeColor = null === $this->strokeColor ? $this->setColor(new Rgb(0, 0, 0)) : $this->setColor($this->strokeColor);
// Draw the line.
imagesetthickness($this->resource, $strokeWidth);
imageline($this->resource, $x1, $y1, $x2, $y2, $strokeColor);
$this->output = $this->resource;
return $this;
}