Exemplo n.º 1
0
 /**
  * @param BoxInterface $size Image dimensions
  *
  * @uses  $width
  * @uses  $height
  * @uses  $resource
  * @uses  BoxInterface::getWidth()
  * @uses  BoxInterface::getHeight()
  * @uses  ImageAbstract::getWidth()
  * @uses  ImageAbstract::getHeight()
  */
 public function __construct(BoxInterface $size)
 {
     $this->width = $size->getWidth();
     $this->height = $size->getHeight();
     $this->resource = imagecreatetruecolor($this->getWidth(), $this->getHeight());
     imagesavealpha($this->resource, true);
     imagealphablending($this->resource, false);
 }
Exemplo n.º 2
0
 /**
  * @return boolean
  * @uses   BoxInterface::getHeight()
  * @uses   BoxInterface::getWidth()
  */
 protected function isSquare(BoxInterface $box)
 {
     return $box->getHeight() == $box->getWidth();
 }