Ver Mensaje Individual
  #10 (permalink)  
Antiguo 13/06/2011, 08:19
Avatar de quike88
quike88
 
Fecha de Ingreso: agosto-2008
Mensajes: 471
Antigüedad: 15 años, 8 meses
Puntos: 87
Respuesta: Dar fondo transparente - GD

si te fijas el enlace que público abimaelrc el código que hace la transparencia se encuentra en el método resize() que son son estas lineas:

Código PHP:
Ver original
  1. public function resize($width, $height)
  2.     {
  3.         $newImage = imagecreatetruecolor($width, $height);
  4.         if($this->getImageType() == 'image/png' && $this->_transparent === true){
  5.             imagealphablending($newImage, false);
  6.             imagesavealpha($newImage, true);
  7.             $transparent = imagecolorallocatealpha($newImage, 255, 255, 255, 127);
  8.             imagefilledrectangle($newImage, 0, 0, $width, $height, $transparent);
  9.         }
  10.         imagecopyresampled($newImage, $this->_image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());
  11.         $this->_image = $newImage;  
  12.     }

Un Saludo