位置: 编程技术 - 正文

PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge)

编辑:rootadmin
imagefttext

推荐整理分享PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php imagecopymerge,php imagestring,php imagecopymerge,php中imagecreatefromjpeg,php中imagecreatefromjpeg,php imagefill,php imagefill,php imagettftext,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.0.7, PHP 5)

imagefttext — 使用 FreeType 2 字体将文本写入图像

说明 array imagefttext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text [, array $extrainfo ] ) 参数

image

由图象创建函数(例如imagecreatetruecolor())返回的图象资源。

size

The font size to use in points.

angle

The angle in degrees, with 0 degrees being left-to-right reading text. Higher values represent a counter-clockwise rotation. For example, a value of would result in bottom-to-top reading text.

x

The coordinates given by x and y will define the basepoint of the first character (roughly the lower-left corner of the character). This is different from the imagestring(), where x and y define the upper-left corner of the first character. For example, "top left" is 0, 0.

y

The y-ordinate. This sets the position of the fonts baseline, not the very bottom of the character.

color

The index of the desired color for the text, see imagecolorexact().

fontfile

The path to the TrueType font you wish to use.

PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge)

Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

When using versions of the GD library lower than 2.0., a space character, rather than a semicolon, was used as the &#;path separator&#; for different font files. Unintentional use of this feature will result in the warning message: Warning: Could not find/open font. For these affected versions, the only solution is moving the font to a path which does not contain spaces.

In many cases where a font resides in the same directory as the script using it the following trick will alleviate any include problems.<?php//SettheenviromentvariableforGDputenv('GDFONTPATH='.realpath('.'));//Namethefonttobeused(notethelackofthe.ttfextension)$font='SomeFont';?>

text

Text to be inserted into image.

extrainfo

Possible array indexes for extrainfo Key Type Meaning linespacing float Defines drawing linespacing

返回值

This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: 0 lower left x-coordinate 1 lower left y-coordinate 2 lower right x-coordinate 3 lower right y-coordinate 4 upper right x-coordinate 5 upper right y-coordinate 6 upper left x-coordinate 7 upper left y-coordinate

范例

Example #1 imagefttext() example

<?php//Createaximage$im=imagecreatetruecolor(,);$red=imagecolorallocate($im,0xFF,0x,0x);$black=imagecolorallocate($im,0x,0x,0x);//Makethebackgroundredimagefilledrectangle($im,0,0,,,$red);//Pathtoourttffontfile$font_file='./arial.ttf';//Drawthetext'PHPManual'usingfontsizeimagefttext($im,,0,,,$black,$font_file,'PHPManual');//Outputimagetothebrowserheader('Content-Type:image/png');imagepng($im);imagedestroy($im);?>

注释

Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0. 及更高版本)。

Note: 此函数仅在PHP 编译时加入 freetype 支持时有效(--with-freetype-dir=DIR)。

更新日志

版本 说明 4.3.5 extrainfo was made optional.

PHP:imagegrabwindow()的用法_GD库图像处理函数 imagegrabwindow(PHP5=5.2.2)imagegrabwindowCapturesawindow说明resourceimagegrabwindow(int$window_handle[,int$client_area=0])Grabsawindoworitsclientareausingawindowshandle(HWNDpropertyinCOMinstance)

PHP:imagegrabscreen()的用法_GD库图像处理函数 imagegrabscreen(PHP5=5.2.2)imagegrabscreenCapturesthewholescreen说明resourceimagegrabscreen(void)Grabsascreenshotofthewholescreen.返回值Returnsanimageresourceidentifieronsuccess,FALSEonfailure.

PHP:imagegd()的用法_GD库图像处理函数 imagegd(PHP4=4.0.7,PHP5)imagegd将GD图像输出到浏览器或文件说明boolimagegd(resource$image[,string$filename])imagegd()将一个GD图像输出到filename。image参数是由imagecreatetrueco

标签: php imagecopymerge

本文链接地址:https://www.jiuchutong.com/biancheng/288335.html 转载请保留说明!

上一篇:PHP:imagegif()的用法_GD库图像处理函数(php中imagecreatefromjpeg)

下一篇:PHP:imagegrabwindow()的用法_GD库图像处理函数

  • 小规模纳税人单张发票最大金额
  • 返利抵扣货款
  • 给员工交的重大医疗保险怎么做分录?
  • 净现值为什么要除以它的折现率
  • 广告制作费可以计入印刷费吗
  • 以前年度亏损本季度盈利所得税
  • 劳务发票可以做费用吗怎么做
  • 行政事业单位2014年前已交社保费
  • 季度营业额超过6万需要补税
  • 物流行业主营业务成本会计分录
  • 如何查询以前申诉进度
  • 未按规定期限办理身份证
  • 固定资产明细账有哪些
  • 期末结转生产成本会计分录
  • 应收预收账款属于什么科目
  • 营改增建筑工程怎么计算举例
  • 企业押金怎么管理
  • 发票金额大于实际支付金额如何报账
  • 哪些费用可以做研发费用
  • 个人股权转让要交增值税吗
  • 财务报表未分配利润为负数
  • 公司收到政府科技创新奖
  • Win10 21H2 Build 21354 ISO 太阳谷官方镜像预览版下载
  • WIN11输入法怎么隐藏到任务栏
  • PHP:session_commit()的用法_Session函数
  • 月入2万的10个小生意低成本
  • uniapp支付流程
  • 购入固定资产如何折旧
  • 公司转让债务债权协议
  • 总包缴税
  • 最小计算机系统包括
  • react_router
  • 基建项目账务处理讲解
  • 个税APP怎么填报扣税最少
  • Spring(十五):Spring整合MyBatis的两种方式
  • sql server数据迁移部分数据
  • 固定资产处置时发生的清理费用
  • sqlserver重复数据
  • 个人出租房屋需要缴纳个税吗
  • 主营业务成本是什么科目
  • 小微企业员工人数限制
  • 企业库存现金的限额是
  • 预收账款所得税汇算清缴需要调吗
  • 实际缴纳的税金比应交的多的部分记入什么科目
  • 关税进口增值税缴纳时间
  • 房地产企业预缴土地增值税
  • 投资性房地产转换日的确定
  • 抵扣旅客运输服务申报时填哪行
  • 业务招待费税务扣除标准
  • 印花税计提表怎么写分录
  • 报销程序是什么
  • mysql常见报错
  • win8怎么自动修复
  • iis怎么用
  • 复制文件文件名过长怎么复制
  • 系统磁盘碎片整理
  • win8磁盘占用率高怎么处理
  • 微软宣布将AI引入Office套件
  • 2021年win10累积更新
  • linux的ps命令用法
  • pqv2isvc.exe - pqv2isvc是什么进程 有什么作用
  • win8小键盘怎么打开
  • iptables入门
  • 安装双系统之后win10进不去
  • win8适用的pr
  • perl ne
  • javascript的核心语言对象包括
  • linux压缩命令compress
  • 统计文件个数linux
  • js中变量有哪几种?分别在哪里定义?
  • Metaio in Unity3d 教学--- 二. 创建自己的Application
  • Struts2+jquery.form.js实现图片与文件上传的方法
  • javascript面向对象编程指南 pdf
  • 浅谈python 四种数值类型(int,long,float,complex)
  • 甘肃国家税务局官网app
  • 税控盘时钟异常怎么办
  • 已办理了退休,档案还需要保存吗
  • 税务代办需要什么资料
  • 中关村税务所上班时间
  • 2021年水资源税征期
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设