Services webmasters
Partenaires
Jeux concours gratuits
 
Constantes prédefinies
<<<
Exemples exif_imagetype
>>>

7.40 Images
7 Index des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Configuration à l'exécution
Types de ressources
Constantes prédefinies
->Exemples
exif_imagetype
exif_read_data
exif_thumbnail
gd_info
getimagesize
image_type_to_mime_type
image2wbmp
imagealphablending
imageantialias
imagearc
imagechar
imagecharup
imagecolorallocate
imagecolorallocatealpha
imagecolorat
imagecolorclosest
imagecolorclosestalpha
imagecolorclosesthwb
imagecolordeallocate
imagecolorexact
imagecolorexactalpha
imagecolormatch
imagecolorresolve
imagecolorresolvealpha
imagecolorset
imagecolorsforindex
imagecolorstotal
imagecolortransparent
imagecopy
imagecopymerge
imagecopymergegray
imagecopyresampled
imagecopyresized
imagecreate
imagecreatefromgd
imagecreatefromgd2
imagecreatefromgd2part
imagecreatefromgif
imagecreatefromjpeg
imagecreatefrompng
imagecreatefromstring
imagecreatefromwbmp
imagecreatefromxbm
imagecreatefromxpm
imagecreatetruecolor
imagedashedline
imagedestroy
imageellipse
imagefill
imagefilledarc
imagefilledellipse
imagegd
imagegd2
imagegif
imageinterlace
imageistruecolor
imagejpeg
imageline
imageloadfont
imagepalettecopy
imagepng
imagepolygon
imagepsbbox
imagepscopyfont
imagepsencodefont
imagepsextendfont
imagepsfreefont
imagepsloadfont
imagepsslantfont
imagepstext
imagerectangle
imagerotate
imagesavealpha
imagesetbrush
imagesetpixel
imagesetstyle
imagesetthickness
imagesettile
imagestring
imagestringup
imagesx
imagesy
imagetruecolortopalette
imagettfbbox
imagettftext
imagetypes
imagewbmp
iptcembed
iptcparse
jpeg2wbmp
png2wbmp
read_exif_data

7.40.7 Exemples

Création d'une image PNG avec PHP

<?php
    header
("Content-type: image/png");
    
$string = $_GET['text'];
    
$im     = imagecreatefrompng("images/button1.png");
    
$orange = imagecolorallocate($im, 220, 210, 60);
    
$px     = (imagesx($im) - 7.5 * strlen($string)) / 2;
    
imagestring($im, 3, $px, 9, $string, $orange);
    
imagepng($im);
    
imagedestroy($im);
?>
Cet exemple doit ̻tre appel̩ depuis une page HTML avec une balise image telle que : <img src="button.php?text"> . Le script ci-dessus, button.php, prend la cha̮ne "text" et l'inscrit sur le fond d'image appel̩ "images/button1.png" et l'affiche. C'est une m̩thode tr̬s pratique pour ̩viter de redessiner un nouveau bouton, d̬s que vous changez le texte d'un bouton. De cette fa̤on, ils sont g̩n̩r̩s dynamiquement .

<< Exemples >>
Constantes prédefinies Images exif_imagetype
Services webmasters
Les manuels
 
CoursPHP.com - Reproduction interdite -