位置: 编程技术 - 正文

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

  • 企业垃圾处理费申报依据
  • 税收分类编码如果选择大类开票会怎样
  • 一般纳税人如何做账报税
  • 先开票后收款违法吗
  • 减免附加税怎么填报
  • 本月销售商品的实际成本怎么算
  • 以前年度应收账款无法收回的账务处理
  • 自然人税收管理系统怎么申报个税
  • 上年多计提增值税,今年如何调整
  • 个人独资企业经营所得税税率表2023
  • 建筑服务适用简易计税吗
  • 外地发票是什么意思
  • 房地产企业土地使用税
  • 跨区域经营企业
  • 账目不清什么意思
  • 发票大头小尾什么意思
  • 无形资产土地使用权摊销年限规定
  • 企业收到赞助费
  • 京东预付定金是什么意思
  • 电子缴税付款凭证怎么做账
  • 出口免税收入会退税吗
  • 其他应交款入哪个科目
  • 股东货币出资比例
  • 应交税费账户期末借方余额反映的是
  • 公司租车费用会计分录
  • 发票不能开怎么回事
  • 供应商退回货款有时间限制吗
  • 批发零售的成本核算
  • 医用酒精出口 需要什么条件
  • 工资现金发放的零头入账
  • 手机型号不在鸿蒙系统里
  • 阻止系统蓝屏后怎么恢复
  • 企业老板机票怎么报销记账
  • 生产经营所得个税表
  • 银行手续费发票税率
  • 无形资产摊销时点
  • 以公允价值计量是什么意思
  • php require include
  • 办理银行承兑汇票支付的手续费计入
  • 企业发放年终奖政府有哪些规定?
  • 进口的应税消费品,于报关进口时缴纳消费税
  • 【强化学习探索01】Win10 下gym安装
  • php pdo类
  • 企业纳税额包括个人所得税吗
  • 一般纳税人使用的是什么会计准则
  • canvas软件教程
  • 研发费用加计扣除75%还是100%
  • 固定资产清理的金额怎么算
  • 收入和成本的原则是什么
  • 服务费的开票项目是什么
  • 营业税减免会计分录
  • 基本户开立账户清单
  • 库存商品暂估入库是什么意思
  • 长期借款利息如何计算
  • mysql的存储引擎有哪些,区别是什么
  • 当月计提的工资,次月申报吗
  • 产品的包装费属于什么科目?
  • 出售在建工程的会计分录怎么做
  • 仓库管理人员工资属于什么费用
  • 下乡扶贫可以报什么岗位
  • 没有进项发票出口免税
  • 运费发票没到可以先计提吗
  • 应收利息和利息收入的差额
  • 工程发票可以抵扣增值税吗
  • 会计错账的更正方法
  • 研发费用如何做分录分析
  • mysql如何实现主从复制的具体流程
  • mysql使用入门教程视频
  • unix是什么语言
  • mac os ftp
  • windows8.1企业版build9600
  • 如何使用airplay2
  • 苹果14pro max价格
  • win7回收站图标在哪个文件夹
  • html5图文混排
  • perl -pe
  • javascript运用
  • 财务局是什么
  • 广告费加计扣除标准
  • 退契税的时间是什么时候
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设