加入收藏 | 设为首页 | 会员中心 | 我要投稿 安卓应用网 (https://www.0791zz.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > PHP > 正文

php imagettftext()函数

发布时间:2020-05-25 02:24:53 所属栏目:PHP 来源:互联网
导读:php imagettftext()函数使用TrueType字体将给定文本写入图像。 本文章向大家介绍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字体的路径。

实例

/*

http://www.manongjc.com/article/1759.html

作者:脚本之家教程

*/

$image = imagecreate(400,300);

$blue = imagecolorallocate($image,255);

$white = ImageColorAllocate($image,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);

?>

(编辑:安卓应用网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读