frameImage() 공개 정적인 메소드

Use when you don't want to replace all pixels in the clipping area with the border color i.e. you want to "frame" the existing image. Preserves transparency etc.
public static frameImage ( &$image, string $color, integer $width, integer $height )
$color string The border color.
$width integer The image width including the border.
$height integer The image height including the border.
예제 #1
0
파일: Border.php 프로젝트: jubinpatel/horde
 /**
  * Draw the border.
  *
  * This draws the configured border to the provided image. Beware,
  * that every pixel inside the border clipping will be overwritten
  * with the background color.
  */
 public function apply()
 {
     if ($this->_params['preserve']) {
         Horde_Image_Imagick::frameImage($this->_image->imagick, $this->_params['bordercolor'], $this->_params['borderwidth'], $this->_params['borderwidth']);
     } else {
         $this->_image->imagick->borderImage(new ImagickPixel($this->_params['bordercolor']), $this->_params['borderwidth'], $this->_params['borderwidth']);
     }
     return true;
 }
예제 #2
0
파일: Border.php 프로젝트: raz0rsdge/horde
 /**
  * Draws the border.
  *
  * This draws the configured border to the provided image. Beware, that
  * every pixel inside the border clipping will be overwritten with the
  * background color.
  */
 public function apply()
 {
     if ($this->_params['preserve']) {
         Horde_Image_Imagick::frameImage($this->_image->imagick, $this->_params['bordercolor'], $this->_params['borderwidth'], $this->_params['borderwidth']);
     } else {
         try {
             $this->_image->imagick->borderImage(new ImagickPixel($this->_params['bordercolor']), $this->_params['borderwidth'], $this->_params['borderwidth']);
         } catch (ImagickPixelException $e) {
             throw new Horde_Image_Exception($e);
         } catch (ImagickException $e) {
             throw new Horde_Image_Exception($e);
         }
     }
 }