Recherche sur les Noms des fonctions php/mysql
imagecreate()
Définition
Crée une nouvelle image à palette - (PHP 4, PHP 5)Description
resource imagecreate
( int $width
, int $height
)
imagecreate() retourne un identifiant d'image représentant une image vide.
Nous recommandons l'utilisation de imagecreatetruecolor() à la place de imagecreate().
Liste de paramètres
- width
-
La largeur de l'image
- height
-
La hauteur de l'image
Valeurs de retour
Retourne un identifiant de ressource d'image en cas de succès, FALSE si une erreur survient.
Exemples
Exemple #1 Création d'une image GD et affichage de cette image
<?php
header("Content-type: image/png");
$im = @imagecreate(110, 20)
or die("Impossible d'initialiser la bibliothèque GD");
$background_color = imagecolorallocate($im, 0, 0, 0);
$text_color = imagecolorallocate($im, 233, 14, 91);
imagestring($im, 1, 5, 5, "A Simple Text String", $text_color);
imagepng($im);
imagedestroy($im);
?>
L'exemple ci-dessus va afficher quelque chose de similaire à :
Bouts de code utilisant la fonction imagecreate()
<?php /* ... */
$counter = 0;
$image = @imagecreate($largeur, $hauteur) or die('Impossible d\'initializer GD')
;
/* ... */ ?>
<?php /* ... */
//on crée une image vierge de dimensions 200*50
$image = imagecreate(200,50);
//Les polices disponibles
/* ... */ ?>
<?php /* ... */
}
$img_handle = ImageCreate (60, 20) or die ("Impossible de créer l'image");
//Image size (x,y)
/* ... */ ?>
<?php /* ... */
$u1 = Rand( 10, 20);
for( $i=1; $i < $u1; $i++)
/* ... */ ?>
Connexion
Les fonctions
Références
- gd_info
- getimagesize
- image_type_to_extension...
- 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...
- imageconvolution
- imagecopy
- imagecopymerge
- imagecopymergegray
- imagecopyresampled
- imagecopyresized
- imagecreate
- imagecreatefromgd2
- imagecreatefromgd2part...
- imagecreatefromgd
- imagecreatefromgif
- imagecreatefromjpeg...
- imagecreatefrompng
- imagecreatefromstring...
- imagecreatefromwbmp...
- imagecreatefromxbm
- imagecreatefromxpm
- imagecreatetruecolor...
- imagedashedline
- imagedestroy
- imageellipse
- imagefill
- imagefilledarc
- imagefilledellipse
- imagefilledpolygon
- imagefilledrectangle...
- imagefilltoborder
- imagefilter
- imagefontheight
- imagefontwidth
- imageftbbox
- imagefttext
- imagegammacorrect
- imagegd2
- imagegd
- imagegif
- imagegrabscreen
- imagegrabwindow
- imageinterlace
- imageistruecolor
- imagejpeg
- imagelayereffect
- imageline
- imageloadfont
- imagepalettecopy
- imagepng
- imagepolygon
- imagepsbbox
- imagepsencodefont
- imagepsextendfont
- imagepsfreefont
- imagepsloadfont
- imagepsslantfont
- imagepstext
- imagerectangle
- imagerotate
- imagesavealpha
- imagesetbrush
- imagesetpixel
- imagesetstyle
- imagesetthickness
- imagesettile
- imagestring
- imagestringup
- imagesx
- imagesy
- imagetruecolortopalette...
- imagettfbbox
- imagettftext
- imagetypes
- imagewbmp
- imagexbm
- iptcembed
- iptcparse
- jpeg2wbmp
- png2wbmp





