(PHP 4, PHP 5, PHP 7, PHP 8)
imagecharup — Draw a character vertically
Draws the character char vertically at the specified
coordinate on the given image.
imageОб'єкт GdImage, що повертається однією з функцій створення зображення, такою як imagecreatetruecolor().
fontМоже бути 1, 2, 3, 4, 5 для вбудованих шрифтів в кодуванні latin2 (де більші числа відповідають більшим шрифтам) або примірником класу GdFont, що повертається функцією imageloadfont().
xx-coordinate of the start.
yy-coordinate of the start.
charThe character to draw.
colorІдентифікатор кольору, створений за допомогою imagecolorallocate().
| Версія | Опис |
|---|---|
| 8.1.0 |
Параметром font тепер може бути як і примірник
GdFont, так і int. Раніше допускався тільки
int.
|
| 8.0.0 |
Тепер image має бути примірником
GdImage. Раніше очікувався
gd-resource.
|
Приклад #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);
?>Поданий вище приклад виведе щось схоже на: