English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

PHP Basic Tutorial

PHP Advanced Tutorial

PHP & MySQL

PHP Reference Manual

PHP imagecharup() function usage and example of drawing a character vertically

PHP Image Processing

imagecharup — Draw a character vertically.

Syntax

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

imagecharup() draws the character c vertically on the image specified by image, at position x, y (the top left corner of the image is 0, 0), with color color. If font is 1,2,3,4 Or 5If you want to use the built-in font.

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);
// Output the black character "Z" on a white background
imagecharup($im, 3, 10, 10, $string, $black);
header('Content-type: image/png');
imagepng($im);
?>

The image of the output result of the above example is as follows:

Related articles

PHP Image Processing