(PHP 4, PHP 5, PHP 7, PHP 8)
imagestringup — Draw a string vertically
Draws a string vertically at the given
coordinates.
imageОб'єкт GdImage, що повертається однією з функцій створення зображення, такою як imagecreatetruecolor().
fontМоже бути 1, 2, 3, 4, 5 для вбудованих шрифтів в кодуванні latin2 (де більші числа відповідають більшим шрифтам) або примірником класу GdFont, що повертається функцією imageloadfont().
xx-coordinate of the bottom left corner.
yy-coordinate of the bottom left corner.
stringThe string to be written.
colorІдентифікатор кольору, створений за допомогою imagecolorallocate().
| Версія | Опис |
|---|---|
| 8.1.0 |
Параметром font тепер може бути як і примірник
GdFont, так і int. Раніше допускався тільки
int.
|
| 8.0.0 |
Тепер image має бути примірником
GdImage. Раніше очікувався
gd-resource.
|
Приклад #1 imagestringup() example
<?php
// create a 100*100 image
$im = imagecreatetruecolor(100, 100);
// Write the text
$textcolor = imagecolorallocate($im, 0xFF, 0xFF, 0xFF);
imagestringup($im, 3, 40, 80, 'gd library', $textcolor);
// Save the image
imagepng($im, './stringup.png');
?>Поданий вище приклад виведе щось схоже на: