Ver Mensaje Individual
  #1 (permalink)  
Antiguo 16/07/2011, 20:31
kozenko
 
Fecha de Ingreso: octubre-2010
Mensajes: 83
Antigüedad: 16 años
Puntos: 1
Transparencia color en imagettftext

Hola!
Estoy tratando de hacer un watermark. Tengo esta funcion:

Código PHP:
<?php
function watermarkImage ($SourceFile, $WaterMarkText, $WaterMarkText2, $DestinationFile) { 
   list(
$width, $height) = getimagesize($SourceFile);
   
$image_p = imagecreatetruecolor($width, $height);
   
$image = imagecreatefrompng($SourceFile);
   
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width, $height); 
   
$black = imagecolorallocate($image_p, 0, 0, 0);
   
$font = 'OctemberScript.ttf';
   
$font_size = 30; 
   
imagettftext($image_p, $font_size, 30, 20, 250, $black, $font, $WaterMarkText);
   
imagettftext($image_p, $font_size, 30, 20, 300, $black, $font, $WaterMarkText2);
   
imagepng ($image_p, $DestinationFile, 9); 
   
imagedestroy($image); 
   
imagedestroy($image_p); 
}
?>
Queria saber como hacer que el color del watermark, en este caso $black sea semi transparente.

Gracias de antemano
Salu2
Koz