Last active
April 7, 2020 17:40
-
-
Save eurowebpage/6f059c7096f5b6ada6d2ee4243762709 to your computer and use it in GitHub Desktop.
ecrire-un-texte-sur-une-image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// créer un fichier exemple ds dossier inc/ textimage1.php | |
// et coller le code si dessous | |
<?php | |
$nom_image = "../img/vide.jpg"; // le nom de votre image avec l'extension jpeg | |
$texte = '#EUROWEBPAGE'; // Le texte que vous désirez écrire sur l'image | |
header ("Content-type: image/jpeg"); | |
$image = imagecreatefromjpeg($nom_image); | |
$blanc = imagecolorallocate($image, 255, 255, 255); | |
imagestring($image, 25, 115, 115,$texte, $blanc); | |
imagejpeg($image); | |
?> | |
// Ensuite ds la page ou vous souhaitez afficher l'image avec le text | |
<img src="inc/textimage1.php" alt="text image" title="text image"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment