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 30
| <?php
header("Content-type: image/jpeg");
$image = $_GET['image'];
$src_im = ImageCreateFromJpeg($image);
$size = GetImageSize($image);
$src_w = $size[0];
$src_h = $size[1];
// Taille nouvelle image
$dst_w = 350;
$dst_h = 120;
$dst_im = ImageCreateTrueColor($dst_w,$dst_h);
// Rééchantillonage
ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);
// Contenu
$couleur = imagecolorallocate($dst_im, 255, 255, 255);
$police = 'arial.ttf';
$text = "<table><tr><td>Essai...</td></tr></table>";
$taille_police = 12;
imagettftext($dst_im, $taille_police, 0, 77, 46, $couleur, $police, $text);
// Création
ImageJpeg($dst_im);
ImageDestroy($dst_im);
imageDestroy($src_im);
?> |
Partager