Bonjour,
j'aimerai savoir comment faire pour insérer un texte sur une image comme ceci:
http://www.imagechef.com/ic/make.jsp?tid=Tree+Heart
j'ai trouvé sur pti ce script :
form.html
Formulaire :
<form method="get" action="image.php">
<input name="texte" type="text"> <input type="submit" value="Envoyer">
</form>
image.php
<?php
if(isset($_GET["texte"])) $texte = $_GET["texte"]; else $texte = "yassine";
header("Content-type: image/jpeg");
$background = imagecreatefromJPEG("foto.jpg");
$imageWidth = 800; // taille X
$imageHeight = 562; // taille Y
$im = imagecreatetruecolor($imageWidth,$imageHeight);
$bgcolor = imagecolorallocate($im,0,0,0);
imagecopy($im,$background,0,0,0,0,$imageWidth,$imageHeight);
imagedestroy($background);
$fontname="tahoma.ttf";
$fontsize = "20";
$angle = "1";
$x = "400";
imagettftext($im,$fontsize,$angle,$x,135,$bgcolor,$fontname,"tu sors,");
imagettftext($im,$fontsize,$angle,$x,170,$bgcolor,$fontname,$texte);
imagettftext($im,$fontsize,$angle,$x,195,$bgcolor,$fontname,"et ne reviens pas !");
imageJPEG($im);
imagedestroy($im);
?>
mais sa marche pas j'obtient sa:
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/yassine/www/fichier/image.php on line 29
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/yassine/www/fichier/image.php on line 31
Warning: imagettftext() [function.imagettftext]: Could not find/open font in /home/yassine/www/fichier/image.php on line 33
voila le script installer dans mon site:
http://yassine.monespace.net/fichier/form.htm
la photo que je veux modifer:
http://yassine.monespace.net/fichier/foto.jpg
pour obtenir ce resultat:
http://62.212.109.174/pika/tu_sors.php?texte=Gniarf
un autre exemple:
http://62.212.109.174/pika/panneau/inde … de+Preview