位置: 编程技术 - 正文

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库图像处理函数

  • 缴纳个人所得税还算应届毕业生吗
  • 个人所得税退税操作流程
  • 所得税税前扣除项目及扣除标准
  • 现金流量表财务净现值怎么算
  • 固定增长定价模型
  • 退休后补发退休前的工资需要扣社保吗
  • 一般纳税人可以转小规模吗
  • 营改增后常用发票报销的种类有哪些呢?
  • 收取外部客户电费如何结转成本
  • 调增应纳税所得额
  • 年末增值税结转账务处理流程
  • 关税不可以抵扣吗
  • 个人独资企业所得税
  • 提示涉税风险该怎么弄
  • 报税申报不了
  • 混营纳税人怎么申报
  • 简易征收工程款可以抵扣吗?
  • 民办学校会计分录 百度网盘
  • 预提返利的会计处理
  • linux怎么安装程序
  • 前期投资费用怎么做账
  • 企业收到政府拆迁补偿款要交税吗怎么做账
  • 最新版小企业会计准则是哪一年的
  • 怎样调整以前年度多计的收入
  • 调整上月费用科目
  • 服务业公司取得的成果
  • macos ppt软件
  • linux 密码重置
  • 怎么设置宽带开关网络
  • 一只草丛里的狐狸作文
  • PHP:pcntl_wifexited()的用法_PCNTL函数
  • 典当行交易是给现金吗
  • 拱门国家公园景点
  • web前端初级知识点
  • php web socket
  • phpcms怎么用
  • 建筑公司预收账款财税怎么处理
  • 购入库存商品会计分录摘要
  • 一般股份支付的确认计量及帐务处理怎么做?
  • 公司进项抵税
  • 企业员工年终奖仲裁
  • 用专项资金支付项目滞纳金合规么
  • SQLite数据库安装及基本操作指南
  • 织梦手机端
  • 小型微利企业所得税按什么预缴
  • 技术服务费怎么收合理
  • 银行承兑汇票和贴现的区别
  • 城建税减半从什么时候开始
  • 哪些合同不需要缴纳印花税的通知
  • 企业为什么要转移用工风险什么意思
  • 承兑汇票的贴现利息
  • 固定资产原值会减少吗
  • 购买新发票的时候要带旧发票去吗?
  • 滞留专票会有什么风险
  • 物流行业会计的工作内容
  • mysql在数据分析中的作用
  • sqlserver数据库中表的类型有哪些
  • win9怎么截图
  • win10如何连接远程电脑
  • 让你的时间更有价值
  • mac安装pyenv
  • ubuntu20.04.1安装
  • 在一台电脑安装两个省份个税系统
  • WIN7系统共享文件夹 您没有权限访问
  • windows7旗舰版怎么打字
  • jquery的事件处理
  • node stream原理
  • script_tool_for_linux.bash: Linux 环境下的 hosts 一键部署脚本
  • 用原生js写项目
  • 后台实时分流文件的shell脚本
  • node.js开发实战
  • jquery jsonview
  • 理解的英文
  • js和jquery可以混用吗
  • android缓存清理
  • 沈阳市税务局全称
  • cfca证书下载流程
  • 票据贴现的票据是什么
  • 生产企业出口退税申报流程操作
  • 收购晾晒烟叶,支付价款20万元,支付价外补贴2万元
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设