您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

php imagettftext函数有什么用

2024/3/2 12:42:02发布11次查看
php imagettftext函数的作用是使用truetype字体将给定文本写入图像,其语法是“array imagettftext( $image,$size,$angle,$x,$y,$color,$fontfile,$text)”。
php imagettftext函数有什么用?
php imagettftext()函数使用truetype字体将给定文本写入图像。
句法
php imagettftext()函数具有以下语法。
array imagettftext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text )
参数
image - 图像资源。
size - 字体大小。
angle - 以度为单位的角度,0度为从左到右读取文本。
x - x和y给出的坐标将定义第一个字符的基点。
y - 纵坐标。
color - 颜色索引。
fontfile - truetype字体的路径。
实例
<?php $image = imagecreate(400,300); $blue = imagecolorallocate($image, 0, 0, 255); $white = imagecolorallocate($image, 255,255,255); imagettftext($image, 44, 15, 50, 200, $white,"arial", "java2s.com"); // set the content-type header("content-type: image/png"); imagepng($image); imagedestroy($image);?>
更多相关知识,请访问!
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product