imagecharup

(PHP 4, PHP 5, PHP 7, PHP 8)

imagecharup垂直地畫一個字符

說明

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

imagecharup() 將字符 c 垂直地畫在 image 指定的圖像上,位于 x,y(圖像左上角為 0, 0),顏色為 color。如果 font 為 1,2,3,4 或 5,則使用內(nèi)置的字體。

示例 #1 imagecharup() 例子

<?php

$im 
imagecreate(100,100);

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

$bg imagecolorallocate($im255255255);
$black imagecolorallocate($im000);

// prints a black "Z" on a white background
imagecharup($im31010$string$black);

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

?>

參見 imagechar()imageloadfont()