1 2 3 4 5 6 7 8 9 10
| $im = @imagecreatetruecolor (100, 50)
or die ("Impossible de créer un flux d'image GD");
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
$background_color = imagecolorallocate ($im, 255, 255, 255);
imagefill($im,0,0,$background_color); //0,0 représentant le point de départ du remplissage : origine de l'image : en haut à gauche.
$text_color = imagecolorallocate ($im, 247, 200, 119);
imagestring ($im, 5, $px, 16, $string, $text_color);
header("content-type: image/png");
imagepng ($im);
imagedestroy ($im); |
Partager