位置: 编程技术 - 正文

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

  • 小企业会计准则是什么意思
  • 销售货物开票及销售收入
  • 财务管理税后利息率计算公式
  • 个体户怎么开增值税普通发票过程
  • 出售无形资产计入资产处置损益
  • 公司茶水间有什么
  • 个人自产自销农产品免税政策
  • 一般纳税人销售旧货
  • 下列应税项目中,不按次计算征收个人所得税的是
  • 企业没有收入怎么办
  • 企业所得税税前扣除政策
  • 2018年所得税表
  • 营业外收入税前列支
  • 买粽子会计怎么做账
  • 单位固定资产出售账务处理
  • 附加税没有计提会计分录
  • 物业公司要怎么开水电费证明
  • 关联企业之间借款的处理
  • 收到社保补助不发放
  • win10一段时间不动黑屏
  • 个税退手续费怎么申请
  • 所有者权益变动表范本
  • 苹果电脑隐藏软件功能怎么开启
  • php自动下载文件到本地
  • 苹果保护你的隐私
  • 子公司接受母公司无偿划转的房屋如何缴纳房产税
  • 原材料结转成本的会计分录例题
  • 如何安装iis网站服务器
  • 利用php计算1+2+3+...+100
  • PHP - EasyUI DataGrid 资料取的方式介绍
  • PHP:mcrypt_decrypt()的用法_Mcrypt函数
  • 生育津贴如何做账
  • 所得税时间性差异与暂时性差异
  • 彩石湖公园门票
  • 银行存款缴纳房产税会计分录
  • php查询sqlserver数据库
  • 自费出版违法吗
  • 纸质承兑财务章怎么盖
  • 其他免税销售额大于0免税性质代码
  • 应收保费核算什么
  • 物流小规模企业有哪些
  • 增值税普通发票税率
  • 出售无形资产净收益计入什么科目
  • mockito mock方法
  • 前端培训费用大概多少
  • 外管证超期
  • 独立核算的分公司注销时账面怎么处理
  • 企业成立刻章流程
  • 上一年的成本没入账怎么做
  • 异地交税怎么交
  • 公户的结算卡是否可以转账
  • 招聘招一个人爱我图片
  • 普惠性幼儿园是什么意思
  • 第三方代销什么意思
  • 销售费用现金支出预算
  • 个税手续费返还比例
  • 固定资产拆除怎么处理
  • 土地承包费和土地租赁费收入记账
  • 未确认融资费用是什么类科目
  • 认证未抵扣往哪里记
  • 一般纳税人农业企业免企业所得吗
  • 事业单位收到钱怎么记账
  • Select count(*)、Count(1)和Count(列)的区别及执行方式
  • mysql数据库高可用方案
  • Windows8.1和Ubuntu14.04双系统卸载Ubuntu的方法
  • bios详细解释
  • aix操作命令
  • linux CentOS/redhat 6.5 LVM分区使用详解
  • jquery 点击按钮
  • bat批处理文件运行不了
  • android全局异常捕获并弹框提示
  • 监控网站是否可以删除
  • threejs入门教程
  • unity unity3d
  • javascript中函数
  • jQuery实现表格文本框淡入更改值后淡出效果
  • unityugui优化
  • 贵州省电子税务局操作手册
  • 广东省纳税信用等级
  • 小规模纳税人是按月还是按季度申报增值税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设