PHP imagecharup - วาดตัวละครในแนวตั้ง
imagecharup - วาดตัวละครในแนวตั้ง
ไวยากรณ์
bool imagecharup ( resource $image , int $font , int $x , int $y , string $c , int $color )
imagecharup () จะวาดตัวอักษร C ในแนวตั้งในรูปของภาพที่ระบุที่ตั้งอยู่ใน x, y (บนซ้ายคือ 0, 0) สีเป็นสี ถ้าตัวอักษรคือ 3, 4 หรือ 5 ใช้ในตัวอักษร
ตัวอย่าง
<?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); ?>
ตัวอย่างข้างต้นของภาพออกเป็นดังนี้
บทความที่เกี่ยวข้อง
- imagechar () ระดับการวาดตัวละคร
- imageloadfont () ในการโหลดแบบอักษรใหม่