Ver Mensaje Individual
  #1 (permalink)  
Antiguo 21/07/2014, 08:18
Avatar de MaNuX0218
MaNuX0218
 
Fecha de Ingreso: marzo-2014
Mensajes: 787
Antigüedad: 10 años, 1 mes
Puntos: 67
Texto en imagen

Hola tengo el script para crear mediante post o get (en mi caso utilizo get) para crear texto en una imagen y lo que quiero consuir es sustituir el tamaño del texto y ponerle una imagen de fondo en vez de un color.

Código PHP:
Ver original
  1. header ("Content-type: image/png");
  2.     $string = $_GET['texto'];
  3.     $font = 5;
  4.     $width = ImageFontWidth($font) * strlen($string) + 100;
  5.     $height = ImageFontHeight($font) + 100;
  6.    
  7.     $im = @imagecreate ($width,$height);
  8.     $background_color = imagecolorallocate($im, 102, 204, 153); //white background
  9.     $text_color = imagecolorallocate ($im, 255, 255,255);//black text
  10.     imagestring($im, $font, 50, 50, $string, $text_color);
  11.     imagepng($im);