Esempio n. 1
0
 public function setColor($color)
 {
     $this->_color = Rgb::normalize($color);
     return $this;
 }
Esempio n. 2
0
 /**
  * 
  * @param type $angle
  * @param array $backgroundColor
  */
 public function rotate($angle, $backgroundColor = null)
 {
     $backgroundColor = $backgroundColor ? Rgb::normalize($backgroundColor) : new Rgb(0, 0, 0, 127);
     // create color
     $backgroundColorId = imageColorAllocateAlpha($this->_resource, $backgroundColor->getRed(), $backgroundColor->getGreen(), $backgroundColor->getBlue(), $backgroundColor->getAlpha());
     // rotate image
     $rotatedImageResource = imagerotate($this->_resource, $angle, $backgroundColorId, true);
     imagealphablending($rotatedImageResource, false);
     imagesavealpha($rotatedImageResource, true);
     $this->loadResource($rotatedImageResource);
     return $this;
 }