PHP imagecharup - 垂直地画一个字符

PHP 教程 · 2019-01-31 09:44:30

imagecharup — 垂直地画一个字符。

语法

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

imagecharup() 将字符 c 垂直地画在 image 指定的图像上,位于 x,y(图像左上角为 0, 0),颜色为 color。如果 font 为 1,2,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() 载入一新字体。

点击查看所有 PHP 教程 文章: https://codercto.com/courses/l/5.html

查看所有标签

Python Machine Learning

Python Machine Learning

Sebastian Raschka / Packt Publishing - ebooks Account / 2015-9 / USD 44.99

About This Book Leverage Python' s most powerful open-source libraries for deep learning, data wrangling, and data visualization Learn effective strategies and best practices to improve and opti......一起来看看 《Python Machine Learning》 这本书的介绍吧!

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具