Ver Mensaje Individual
  #67 (permalink)  
Antiguo 18/07/2011, 06:17
Avatar de iviamontes
iviamontes
 
Fecha de Ingreso: enero-2011
Ubicación: $cubano->Arg->Mendoza
Mensajes: 1.184
Antigüedad: 15 años, 9 meses
Puntos: 209
Respuesta: [APORTE] Subir y redimensionar imagenes

@abimaelrc a tu consideración:

por si se quiere poner una marca de agua de solo texto.


modo de uso

Código PHP:
$color = array("R"=>0, "G"=>0,"B"=>255);
$image->textwatermark('cadena', 'button', $color); 
Código PHP:
 public function textwatermark($string, $position="button", $color = array( "R"=>0, "G"=>0,"B"=>0 ) ){
        
$x = $y = 0;
        switch(
$position)
        {
            case 
"top":    
                    break;
            case 
"button":
                    
$x = ($this->getWidth() - strlen($string)*10) + 5 ;
                    
$y = $this->getHeight() - 20; 
                    break;
          case 
"middle":
                    
$x = ( $this->getWidth() - strlen($string)*10 ) / 2; 
                    
$y = $this->getHeight() / 2; 
                    break;    
        }
        
$textcolor = imagecolorallocate($this->_image, $color['R'], $color['G'], $color['B']);
        
imagestring($this->_image, 5, $x, $y, $string, $textcolor    );
        return 
$this->_image;
    } 
Nota:No puse el texto semitransparente para dejarlo a tu consideración...
un método más para nuestro "monstruo phpero"
__________________
aconcaguaestudio.com