Wall posté le Jeudi 26 avril 2007


no soucy


  1. <?php  
  2.  
  3. // usage : http://(...) /tu_sors.php?texte=toto  
  4.  
  5. // licence type BSD : http://62.212.109.174/pika/LICENCE.txt  
  6.  
  7. if(isset($_GET["texte"])) $texte = $_GET["texte"]; else $texte = "Gniarf";  
  8.  
  9.  
  10. header("Content-type: image/jpeg");  
  11.  
  12. $background = imagecreatefromJPEG("tu_sors.jpg");  
  13.  
  14.  
  15.  
  16. $imageWidth = 800; // taille X  
  17.  
  18. $imageHeight = 562; // taille Y  
  19.  
  20. $im = imagecreatetruecolor($imageWidth,$imageHeight);  
  21.  
  22. //$bgcolor = imagecolorallocate($im,67,73,69);  
  23. $bgcolor = imagecolorallocate($im,0,0,0);  
  24. //imagecolortransparent($im,$bgcolor);  
  25.  
  26. imagecopy($im,$background,0,0,0,0,$imageWidth,$imageHeight);  
  27.  
  28. imagedestroy($background);  
  29.  
  30.  
  31. $fontname="./tahoma.ttf";  
  32. $fontsize = "20";  
  33. $angle = "1";  
  34. $x = "400";  
  35.  
  36.  
  37. imagettftext($im,$fontsize,$angle,$x,135,$bgcolor,$fontname,"tu sors,");  
  38.  
  39. imagettftext($im,$fontsize,$angle,$x,170,$bgcolor,$fontname,$texte);   
  40.  
  41. imagettftext($im,$fontsize,$angle,$x,195,$bgcolor,$fontname,"et ne reviens pas !");  
  42.  
  43.  
  44.  
  45. imageJPEG($im);  
  46. imagedestroy($im);  
  47.  
  48.  
  49. ?> 

Remonter Remonter
L'éditeur javascript - CSS - Gentoo - Tutoriaux PHP - Tutoriels PHP - Breizh Blog