src/UI/Image/Watermark.php
protected function calculatePosition( $image )
	{
		switch( $this->positionH )
		{
			case 'left':
				$posX	= 0 + $this->marginX;
				break;
			case 'center':
				$posX	= ceil( $image->getWidth() / 2 - $this->stamp->getWidth() / 2 );
				break;
			case 'right':
				$posX	= $image->getWidth() - $this->stamp->getWidth() - $this->marginX;
				break;
		}
		switch( $this->positionV )
		{
			case 'top':
				$posY	= 0 + $this->marginY;
				break;
			case 'middle':
				$posY	= ceil( $image->getHeight() / 2 - $this->stamp->getHeight() / 2 );
				break;
			case 'bottom':
				$posY	= $image->getHeight() - $this->stamp->getHeight() - $this->marginY;
				break;
		}
		$position	= array(
			'x'	=> $posX,
			'y'	=> $posY
		);
		return $position;
	}
protected function calculatePosition( $image )
	{
		switch( $this->positionH )
		{
			case 'left':
				$posX	= 0 + $this->marginX;
				break;
			case 'center':
				$posX	= ceil( $image->getWidth() / 2 - $this->stamp->getWidth() / 2 );
				break;
			case 'right':
				$posX	= $image->getWidth() - $this->stamp->getWidth() - $this->marginX;
				break;
		}
		switch( $this->positionV )
		{
			case 'top':
				$posY	= 0 + $this->marginY;
				break;
			case 'middle':
				$posY	= ceil( $image->getHeight() / 2 - $this->stamp->getHeight() / 2 );
				break;
			case 'bottom':
				$posY	= $image->getHeight() - $this->stamp->getHeight() - $this->marginY;
				break;
		}
		$position	= array(
			'x'	=> $posX,
			'y'	=> $posY
		);
		return $position;
	}
protected function calculatePosition ( $ image ) { switch ( $ this -> positionH ) { case 'left' : $ posX = 0 + $ this -> marginX ; break ; case 'center' : $ posX = ceil ( $ image -> getWidth ( ) / 2 - $ this -> stamp -> getWidth ( ) / 2 ) ; break ; case 'right' : $ posX = $ image -> getWidth ( ) - $ this -> stamp -> getWidth ( ) - $ this -> marginX ; break ; } switch ( $ this -> positionV ) { case 'top' : $ posY = 0 + $ this -> marginY ; break ; case 'middle' : $ posY = ceil ( $ image -> getHeight ( ) / 2 - $ this -> stamp -> getHeight ( ) / 2 ) ; break ; case 'bottom' : $ posY = $ image -> getHeight ( ) - $ this -> stamp -> getHeight ( ) - $ this -> marginY ; break ; } $ position = array ( 'x' => $ posX , 'y' => $ posY ) ; return $ position ; }
Return Array with Coords of Stamp Image within a given Image.
@access		protected
@param		resource		$img 		Image Resource
@return		array
Return Array with Coords of Stamp Image within a given Image .