Пример #1
0
 /**
  * @param Image $image
  * @param AddTextParams $params
  * @param string $text
  * @param int $placeWidth
  */
 private function renderLine(Image $image, AddTextParams $params, $text, $placeWidth)
 {
     $leftPadding = $this->getLeftPadding($params, $text, $placeWidth);
     // velikost radku je 30, velikost pisma je 16, takze bude 7px nad a pod textem
     $space = round(($params->lineHeight - $params->size) / 2);
     imagettftext($image->getResource(), $params->size, 0, $this->lastCoords->getX() + $leftPadding, $this->lastCoords->getY() + $params->lineHeight - $space, $params->color, $params->fontFile, $text);
     $this->lastCoords->addY($params->lineHeight);
 }
Пример #2
0
 /**
  * @param Image $image
  * @param Coords $coords
  */
 public function addImage(Image $image, Coords $coords)
 {
     imagecopy($this->resource, $image->getResource(), $coords->getX(), $coords->getY(), 0, 0, $image->getWidth(), $image->getHeight());
 }