位置: 编程技术 - 正文

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

  • 一般纳税人企业所得税是多少
  • 转让股份的印花税怎么交
  • 企业其他税负率计算公式?
  • 消费税退回退税流程
  • 一般纳税人金税盘抵税会计分录
  • 发生租赁费用怎么做账
  • 税率开错了影响征税吗
  • 对外捐赠计入
  • 劳务服务公司不含派遣,能接外包吗
  • 增值税专用发票可以开电子发票吗
  • 无偿划拨资产涉税问题
  • 财务费用利息如何结转
  • 小微企业利息收入增值税
  • 进项税额抵减欠税后附加税可以抵减吗
  • 融资租赁中承租人的权利
  • 收入确认和发票的区别
  • 房产税逾期有滞纳金吗
  • 怎么开个体工商户
  • 资源税扣缴义务人代扣代缴税款的纳税义务发生时间
  • 长期零申报有什么影响
  • 增值税一般纳税人与小规模纳税人的区别
  • 个体户需要对公户吗
  • microsoft edge怎么改成ie11
  • 货物运输业的增值税税率
  • windows11怎么设置默认应用
  • macos使用技巧
  • 外币债券汇兑损益怎么算
  • 前端加密后端解密代码
  • 税法中一年按多少天算
  • 购买原材料月末需要结转吗
  • 电力安装公司都有什么业务
  • pytorch train()
  • vgremove命令
  • 计提本月财务费用会计分录
  • vue挂载dom
  • 公司注册资金多长时间可提出来
  • 施工单位奖金分配方案
  • 合并范围外关联方需要函证吗
  • 运输发票抵扣进项税额
  • 支付给临时工的费用
  • 开具利息收入发票需不需要有经营范围
  • 金税盘清卡失败增值税未申报或未比对
  • 企业所得税的内容比土地增值税的多了
  • mysql数据库命名 可以用-吗
  • 股权激励费用摊销意思是
  • 应收账款属于什么会计要素
  • 必要报酬率怎么求
  • 个税汇算清缴是退税吗
  • 产品研发项目管理 系统 国外
  • 应纳税额和已缴税额一样
  • 收取的承包费交什么税
  • 开发成本期末如何结转
  • 管理费用抵消分录
  • 主营业务成本暂估怎么算
  • 合并报表编制方法有几种
  • 出口退税过期怎么处理
  • sql中cursor是什么意思
  • win7系统换桌面
  • WIN10家庭版系统怎么禁用Device
  • 今日推送是什么
  • npfmntor.exe - npfmntor是什么进程 有什么用
  • linux检查更新
  • 听歌播放失败什么意思
  • 你可能不知道的中融新大
  • win7 64位旗舰版系统网页字体大小如何修改变动
  • 飞完整版歌曲
  • nodejs搭建web服务器
  • perl 获取参数
  • perl pop push shift unshift实例介绍
  • cocos2dx-js
  • 编写自己的linux系统
  • shell循环结构
  • unity collider类属性方法
  • python问题及解决方法
  • Android-Canvas.drawText()详解
  • unity3d从入门到精通
  • js手势放大缩小
  • 郑州市惠济区税务局黄国选
  • 企业所得税年报什么时候开始申报
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设