downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

imagesx> <imagestring
Last updated: Fri, 14 Aug 2009

view this page in

imagestringup

(PHP 4, PHP 5)

imagestringupDessine une chaîne verticale

Description

bool imagestringup ( resource $image , int $font , int $x , int $y , string $string , int $color )

Dessine une chaîne sur une ligne verticale dans l'image image aux coordonnées spécifiées.

Liste de paramètres

image

Une ressource d'image, retourné par une des fonctions de création d'images, comme imagecreatetruecolor().

font

Peut être 1, 2, 3, 4, 5 pour les polices internes d'encodage Latin2 (où les plus grands nombres correspondent aux polices larges) ou n'importe quels identifiants de police de votre choix, enregistrées avec la fonction imageloadfont().

x

X : coordonnée du coin en haut, à gauche.

y

Y : coordonnée du coin en haut, à gauche.

string

La chaîne de caractères à écrire.

color

Un identifiant de couleur créé par la fonction imagecolorallocate().

Valeurs de retour

Cette fonction retourne TRUE en cas de succès, FALSE en cas d'échec.

Exemples

Exemple #1 Exemple avec imagestring()

<?php
// Création d'une image de 100*100 pixels
$im imagecreatetruecolor(100100);

// Dessine un texte
$textcolor imagecolorallocate($im0xFF0xFF0xFF);
imagestringup($im34080'gd library'$textcolor);

// Sauvegarde l'image
imagepng($im'./stringup.png');
imagedestroy($im);
?>

L'exemple ci-dessus va afficher quelque chose de similaire à :

Voir aussi



add a note add a note User Contributed Notes
imagestringup
13-Dec-2002 01:19
function imagestringdown(&$image, $font, $x, $y, $s, $col)
{
    $width = imagesx($image);
   $height = imagesy($image);
   
    $text_image = imagecreate($width, $height);

   $white = imagecolorallocate ($text_image, 255, 255, 255);
   $black = imagecolorallocate ($text_image, 0, 0, 0); 

    $transparent_colour = $white;
   if ($col == $white)
      $transparent_color = $black;
 
   imagefill($text_image, $width, $height, $transparent_colour);
   imagecolortransparent($text_image, $transparent_colour);
 
   imagestringup($text_image, $font, ($width - $x), ($height - $y), $s, $col);
   imagerotate($text_image, 180.0, $transparent_colour);
 
   imagecopy($image, $text_image, 0, 0, 0, 0, $width, $height);
}

imagesx> <imagestring
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites