1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
|
<?php
$file_name = 'photo.jpg';
$write_w = 1680;
$source = imagecreatefromjpeg($file_name);
//couleur noire pour le texte
$black = imagecolorallocate($source,0,0,0);
$nom = "name";
$prenom = "prename";
$tel = "06 01 02 03 04";
$email = "test@test.com";
imagettftext($source, 30, 0, $write_w, 1190, $black, "verdana.ttf", $nom);
imagettftext($source, 30, 0, $write_w, 1276, $black, "verdana.ttf", $prenom);
imagettftext($source, 30, 0, $write_w, 1606, $black, "verdana.ttf", $tel);
imagettftext($source, 30, 0, $write_w, 1686, $black, "verdana.ttf", $email);
$image_name = rand(1,999).'invitation_'.$prenom.'_'.$nom.'.jpg';
$saveas = $image_name;
imagejpeg($source,$saveas);
imagedestroy($source);
?> |
Partager