位置: 编程技术 - 正文

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

  • 物业公司车位出租能开具什么发票
  • 个人勾机给公司开票怎么开
  • 汽车销售和租赁哪个大
  • 税法规定的增值税
  • 退回股东投资款现金流量
  • 电子发票怎么开具
  • 税控盘清卡失败
  • 咨询费计入什么管理费用的什么科目
  • 支出和成本的关系和区别
  • 生育津贴需要连续缴纳社保满一年吗
  • 出售使用过的生产设备
  • 营业外支出企业所得税怎么填
  • 费用摊销怎么做
  • 结转产成品会计分录怎么做
  • 购买理财产品现金流量处理怎么做?
  • 一般纳税人进货收到普通发票
  • 营改增后哪些进项不能抵扣
  • 劳务费做账要交个人所得税吗?
  • 关于增值税的问题有哪些
  • 连续亏损二年怎么处理
  • 关于工程材料的图书有哪些
  • Mac SIP系统完整性保护开启及关闭的方法介绍
  • 一借多贷的会计分录怎么写
  • 企业委托境外研发所发生的费用
  • yii2框架运行原理
  • 可抵扣增值税有哪些
  • 后端怎么把图片传给前端的
  • 为什么结转各项支出时本年利润在借方
  • 房产前期开发
  • 餐饮类的增值税
  • 新个税讲解
  • 谷歌浏览器无法安装
  • 高通芯片开发
  • css中设置字体样式
  • 芝麻信用app
  • 水费发票掉了可以补打吗
  • 航天金税税控盘运行环境
  • sql server附加数据库出错
  • java基本框架
  • python如何实现事务机制
  • 企业收购合并中土地问题
  • db2 history
  • 交易性金融资产的账务处理
  • 购销合同印花税计税依据
  • 联营单位投入的款项
  • 如何在科目余额表中查询给另一家公司付了多少钱
  • 租赁动迁补偿条款
  • 影视公司临时演员怎么办
  • 返利开红字发票怎么做账
  • 买车保险返现是什么意思
  • 员工的探亲费应由谁支付
  • 资产负债表资产按照什么顺序
  • 目标考核奖金做什么科目
  • 屠宰税属于什么税
  • mysql查询语句优先级
  • 进程管理界面
  • 轻松玩转职场职场沟通与写作技巧答案
  • windows10cortana搜索框
  • Mac怎么快速显示桌面
  • Ubuntu14.04 的 SSH 无密码登录的设置方法
  • win7系统桌面图标有遮挡
  • gnome版本
  • 微软64位Win10 Mobile很快到来 Surface Phone有望搭载
  • 自由选择工具快捷键
  • win10预览版绿屏重启解决
  • bat查看ip地址和mac地址
  • django在pycharm
  • 深入理解中国式现代化
  • 在dos下删除文件
  • unityui插件
  • javascript用处
  • 基于JAVASCRIPT实现的可视化工具是
  • 4种JavaScript实现简单tab选项卡切换的方法
  • javascript 自定义类
  • 广东省电子税务局登录方式
  • 双色球兑奖方式选法
  • 税务系统运维应急预案范文
  • 中国的外籍
  • 机票票号怎么查航班
  • 公司有房屋租赁许可证吗
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设