位置: 编程技术 - 正文

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

编辑:rootadmin
imageftbbox

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

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

(PHP 4 >= 4.0.7, PHP 5)

imageftbbox — 给出一个使用 FreeType 2 字体的文本框

说明 array imageftbbox ( float $size , float $angle , string $fontfile , string $text [, array $extrainfo ] )

This function calculates and returns the bounding box in pixels for a FreeType text.

参数

size

字体的尺寸。根据 GD 的版本,为像素尺寸(GD1)或点(磅)尺寸(GD2)。

angle

Angle in degrees in which text will be measured.

fontfile

The name of the TrueType font file (can be a URL). Depending on which version of the GD library that PHP is using, it may attempt to search for files that do not begin with a leading &#;/&#; by appending &#;.ttf&#; to the filename and searching along a library-defined font path.

text PHP:imageftbbox()的用法_GD库图像处理函数(php imagettftext)

The string to be measured.

extrainfo

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

返回值

imageftbbox() returns an array with 8 elements representing four points making the bounding box of the text: 0 lower left corner, X position 1 lower left corner, Y position 2 lower right corner, X position 3 lower right corner, Y position 4 upper right corner, X position 5 upper right corner, Y position 6 upper left corner, X position 7 upper left corner, Y position

The points are relative to the text regardless of the angle, so "upper left" means in the top left-hand corner seeing the text horizontally.

范例

Example #1 imageftbbox() example

<?php//Createaximage$im=imagecreatetruecolor(,);$black=imagecolorallocate($im,0,0,0);$white=imagecolorallocate($im,,,);//Setthebackgroundtobewhiteimagefilledrectangle($im,0,0,,,$white);//Pathtoourfontfile$font='./arial.ttf';//Firstwecreateourboundingbox$bbox=imageftbbox(,0,$font,'ThePHPDocumentationGroup');//ThisisourcordinatesforXandY$x=$bbox[0]+(imagesx($im)/2)-($bbox[4]/2)-5;$y=$bbox[1]+(imagesy($im)/2)-($bbox[5]/2)-5;imagefttext($im,,0,$x,$y,$black,$font,'ThePHPDocumentationGroup');//Outputtobrowserheader('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:imagegammacorrect()的用法_GD库图像处理函数 imagegammacorrect(PHP4,PHP5)imagegammacorrect对GD图像应用gamma修正说明boolimagegammacorrect(resource$image,float$inputgamma,float$outputgamma)imagegammacorrect()函数用给定的输入gamma

PHP:imagefontwidth()的用法_GD库图像处理函数 imagefontwidth(PHP4,PHP5)imagefontwidth取得字体宽度说明intimagefontwidth(int$font)返回指定字体一个字符宽度的像素值。参见imagefontheight()和imageloadfont()。

PHP:imagefilledarc()的用法_GD库图像处理函数 imagefilledarc(PHP4=4.0.6,PHP5)imagefilledarc画一椭圆弧且填充说明boolimagefilledarc(resource$image,int$cx,int$cy,int$width,int$height,int$start,int$end,int$color,int$style)在指定的image

标签: php imagettftext

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

上一篇:PHP:imagegd2()的用法_GD库图像处理函数(php imagettftext()函数)

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

  • 账本印花税的计税依据
  • 税金及附加是负债类吗
  • 印花税的会计分录有哪些
  • 大巴车怎么进行营运
  • 公司名称变更在哪个网站
  • 税务变更需要哪些材料
  • 企业纳税成本管理方案
  • 资产损失税前扣除管理办法2019
  • 无法收回的应收账款情况说明
  • 电子产品委外加工
  • 电费应收电费和实际电费
  • 不再认证时段内
  • 股权稀释需要交税吗
  • 企业法人投资股4 账户
  • 减免税款怎么入账
  • 个体户要申报哪些报表
  • 医院企业所得税免税吗
  • 增值税和消费税的区别和联系
  • 上季度多交的增值税怎么做账
  • 所得税补缴自查需要缴纳什么
  • 车辆购置税退税条件
  • 发票两边的孔怎么做
  • 资产评估入账的评估报告
  • 税务登记证遗失了怎么注销
  • 个人所得税哪些可以专项扣除
  • Linux系统复制粘贴
  • 欠款利息收入如何入账
  • 腾讯电脑管家病毒库更新
  • 苹果关闭safari
  • 捷波主板141m
  • 返利给客户的账务处理
  • u盘无法格式化为NTFS
  • 经营租赁的房屋计提折旧吗
  • phpwhile用法
  • 外企采购回扣普遍吗
  • 退税的项目有哪些
  • 员工餐费需要附什么凭证
  • 通讯费补贴如何入账
  • 猴子摘桃玩法
  • php邮件发送类
  • 蓝桥杯真题c语言
  • 关基系统防SSL证书断供,知道创宇“包办式”国密改造方案省心又安全
  • fio命令详解
  • 购买房屋用于出租属于投资行为吗
  • 销售佣金 会计分录
  • python 顺序
  • dedecms标签怎么用
  • pytest unittest
  • 资产负债表跟利润表勾稽关系公式
  • 冲回多提的坏账准备会计分录
  • 房产税和城镇土地使用税
  • 存货核算方法有五种
  • 没有认证抵扣的发票如何冲红
  • 母公司无偿给子公司房屋使用谁交房产税呢
  • 印花税缴款了发票怎么查
  • 已收款未开票未发货能确认收入吗
  • 委托代理进出口
  • 账上存货太多实收怎么办
  • 特殊事项税务处理
  • win10怎么给Windows Defender添加排除项?
  • win8.1重置电脑
  • win8.1安装秘钥
  • windows server 2016最大内存
  • mac外接显示器不显示全部桌面
  • 苹果怎么格式化彻底
  • win10开机黑屏进入不了系统界面
  • win7笔记本电池电量显示怎么设置
  • windows8 defender
  • 清除文件内容 linux
  • z-blog SyntaxHighlighter 长代码无法换行解决办法(基于jquery)
  • rapidjson使用
  • android获取位置信息
  • 一个简单的shell脚本
  • 批处理打开网络连接
  • js字段截取
  • js数组操作的常用方法有哪些
  • 纳税人类型税码是什么
  • 陕西省税务发票查询系统
  • 单位名称变更后发票还能用吗
  • 贵州省税务局领导介绍
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设