Latest web development tutorials

PHP imagecharup - Draw a character vertically

PHP Image Processing PHP Image Processing

imagecharup - Draw a character vertically.

grammar

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

imagecharup () will draw character c vertically in the image of the specified image, located in x, y (top left is 0, 0), the color is color. If the font is 3, 4 or 5, use the built-in fonts.

Examples

<?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);

// 在白色的背景上输出黑色的 "Z"
imagecharup($im, 3, 10, 10, $string, $black);

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

?>

The above example of the output picture is as follows:

related articles

PHP Image Processing PHP Image Processing