Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/09/2009, 23:45
samu22
 
Fecha de Ingreso: abril-2008
Mensajes: 453
Antigüedad: 16 años, 1 mes
Puntos: 16
Respuesta: Fuente de texto en imagen

Código php:
Ver original
  1. header('Content-type: image/png');
  2.  
  3. // imagen
  4. $im = imagecreatetruecolor(200, 30);
  5.  
  6. // colores
  7. $white = imagecolorallocate($im, 255, 255, 255);
  8. $grey = imagecolorallocate($im, 128, 128, 128);
  9. $black = imagecolorallocate($im, 0, 0, 0);
  10. imagefilledrectangle($im, 0, 0, 199, 29, $white);
  11.  
  12. //texto
  13. $text = 'php';
  14.  
  15. $font = 'arial.ttf';
  16.  
  17. imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);