-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.php
29 lines (23 loc) · 795 Bytes
/
test.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
<?php
// Définition du content-type
header('Content-Type: image/png');
// Création de l'image
$im = imagecreatetruecolor(400, 30);
// Création de quelques couleurs
$white = imagecolorallocate($im, 255, 255, 255);
$grey = imagecolorallocate($im, 128, 128, 128);
$black = imagecolorallocate($im, 0, 0, 0);
imagefilledrectangle($im, 0, 0, 399, 29, $white);
// Le texte à dessiner
$text = 'Test...';
// Remplacez le chemin par votre propre chemin de police
$font = realpath('lucon.ttf');
// Ajout d'ombres au texte
imagettftext($im, 20, 0, 11, 21, $grey, $font, $text);
// Ajout du texte
imagettftext($im, 20, 0, 10, 20, $black, $font, $text);
// Utiliser imagepng() donnera un texte plus claire,
// comparé à l'utilisation de la fonction imagejpeg()
imagepng($im);
imagedestroy($im);
?>