holaaa he encontrado un código que convertía un texto a una imagen, le he quitado el texto de defecto, i he creado una pagina principal, que da al usuario un campo para meter el texto i lo guarda en la variable text, i entonces ejecuta este script:
<?php
define( 'FONT_DIR', './' );
include( './image_functions.php' );
$text;
$req_height = 1;
$width = 400;
$text = preg_replace( '/\n/', ' ', $text ) ;
// grab font
$font = FONT_DIR . '/Vera.ttf';
// black and white here
$image = imagecreate( $width, $req_height );
$bg_color = ImageColorAllocate( $image, 255, 255, 255 );
$color = ImageColorAllocate( $image, 0, 0, 0 );
$textSize = 10;
$angle = 0;
$top = 10;
$left = 0;
$right = $width;
// ImageTTFText( $image, $size, $angle, $top, $left, $text_color, $font , $description );
$height = imageprintWordWrapped(&$image, $top, $left, $right, $font, $color, $text, $textSize, $halign="left") ;
if( $height > $req_height )
{
ImageDestroy( $image );
$image = imagecreate( $width, ( $height + ( 50 ) ));
$bg_color = ImageColorAllocate( $image, 255, 255, 255 );
$color = ImageColorAllocate( $image, 0, 0, 0 );
imageprintWordWrapped(&$image, $top, $left, $right, $font, $color, $text, $textSize, $halign="left") ;
}
header( 'Content-type: image/png' );
ImagePNG( $image );
?>
sabrías alguna forma para poder guardar esta imagen a un directorio? lo que queria hacer es guardar la imagen en una carpeta determinada i la imagen con un nombre aleatorio, pero he probado algunos códigos i no me acaban de funcionar del todo bien, GRACIAS