Forum und email
imagecharup

imagecharup

(PHP 3, PHP 4, PHP 5)

imagecharup -- Draw a character vertically

Opis

bool imagecharup ( resource image, int font, int x, int y, string c, int color )

Draws the character c vertically at the specified coordinate on the given image.

Parametry

obraz

Zasób obrazu, zwrócony przez jedną z funkcji tworzących obrazy, taką jak imagecreatetruecolor().

czcionka

Może przyjąć 1, 2, 3, 4, 5 dla wbudowanych czcionek (gdzie większy numer odpowiada większej czcionce) lub własny dowolny identyfikator czcionki zarejestrowany przez imageloadfont().

x

x-coordinate of the start

y

y-coordinate of the start

c

The character to draw

color

A color identifier created with imagecolorallocate()

Zwracane wartości

Zwraca TRUE w przypadku sukcesu, FALSE w przypadku porażki.

Przykłady

Przykład 1. imagecharup() example

<?php

$im
= imagecreate(100, 100);

$string = 'Note that the first letter is a N';

$bg = imagecolorallocate($im, 255, 255, 255);
$black = imagecolorallocate($im, 0, 0, 0);

// prints a black "Z" on a white background
imagecharup($im, 3, 10, 10, $string, $black);

header('Content-type: image/png');
imagepng($im);

?>

Powyższy przykład wyświetli coś podobnego do: