code/extensions/ExtendedGDBackend.php
public function merge(GDBackend $image){
        
        imagealphablending($this->owner->getImageResource(), false);
		imagesavealpha($this->owner->getImageResource(), true);
        
        imagealphablending($image->getImageResource(), false);
		imagesavealpha($image->getImageResource(), true);
        
        $srcX = 0;
        $srcY = 0;
        $srcW = $image->getWidth();
        $srcH = $image->getHeight();
        $dstX = round(($this->owner->getWidth() - $srcW)/2);
        $dstY = round(($this->owner->getHeight() - $srcH)/2);
        $dstW = $image->getWidth();
        $dstH = $image->getHeight();
        
        imagecopyresampled($this->owner->getImageResource(), $image->getImageResource(), $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
        
        $output = clone $this->owner;
		$output->setImageResource($this->owner->getImageResource());
		return $output;
    }
public function merge(GDBackend $image){
        
        imagealphablending($this->owner->getImageResource(), false);
		imagesavealpha($this->owner->getImageResource(), true);
        
        imagealphablending($image->getImageResource(), false);
		imagesavealpha($image->getImageResource(), true);
        
        $srcX = 0;
        $srcY = 0;
        $srcW = $image->getWidth();
        $srcH = $image->getHeight();
        $dstX = round(($this->owner->getWidth() - $srcW)/2);
        $dstY = round(($this->owner->getHeight() - $srcH)/2);
        $dstW = $image->getWidth();
        $dstH = $image->getHeight();
        
        imagecopyresampled($this->owner->getImageResource(), $image->getImageResource(), $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH);
        
        $output = clone $this->owner;
		$output->setImageResource($this->owner->getImageResource());
		return $output;
    }
public function merge ( GDBackend $ image ) { imagealphablending ( $ this -> owner -> getImageResource ( ) , false ) ; imagesavealpha ( $ this -> owner -> getImageResource ( ) , true ) ; imagealphablending ( $ image -> getImageResource ( ) , false ) ; imagesavealpha ( $ image -> getImageResource ( ) , true ) ; $ srcX = 0 ; $ srcY = 0 ; $ srcW = $ image -> getWidth ( ) ; $ srcH = $ image -> getHeight ( ) ; $ dstX = round ( ( $ this -> owner -> getWidth ( ) - $ srcW ) / 2 ) ; $ dstY = round ( ( $ this -> owner -> getHeight ( ) - $ srcH ) / 2 ) ; $ dstW = $ image -> getWidth ( ) ; $ dstH = $ image -> getHeight ( ) ; imagecopyresampled ( $ this -> owner -> getImageResource ( ) , $ image -> getImageResource ( ) , $ dstX , $ dstY , $ srcX , $ srcY , $ dstW , $ dstH , $ srcW , $ srcH ) ; $ output = clone $ this -> owner ; $ output -> setImageResource ( $ this -> owner -> getImageResource ( ) ) ; return $ output ; }
Merge two Images together
Merge two Images together