位置: 编程技术 - 正文

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计划任务crontab
  • 事业单位项目前景怎么样
  • 预缴增值税会产生滞纳金吗
  • 其他综合收益是什么意思
  • 出租设备的租金计入哪个科目
  • 公司赞助商
  • 如何使用vim创建文件
  • 公路客运车辆
  • 个体工商户生产经营所得税税率表2023
  • 评价指标mae
  • php一个页面多个分页
  • 预缴的附加税怎么填表抵减
  • 开源ei
  • ChatGPT遭禁用、抵制后又停止Plus付费发生了?
  • php static变量
  • linux mail命令详解
  • css 3有哪些新特性
  • 电影制片过程
  • 小规模纳税人定义
  • 本月没有销项只有进项 还认证发票吗
  • 出口货物申报表如何填写
  • 个人收到承兑汇票
  • sqlserver2008r2数据库导出教程
  • 库存商品总分类账范本
  • 营业税金及附加是什么科目
  • 哪些税计入税金及附加
  • 企业从应付职工工资中代扣的职工房租应借记什么科目
  • 销售费用现金支出预算
  • 承兑汇票贴现计算器下载
  • 直接人工成本包括管理人员开的工资吗
  • 跨年度冲红字发票怎么冲
  • 先清卡后报税影响申报吗
  • 餐饮业做账会计分录大全,实用!
  • 应收账款是净额列示吗
  • 公司被私募基金收购有啥影响 裁员
  • 产品是如何产生的
  • win2000注册表
  • win7系统修改
  • win7升级win10系统版本软件还有吗
  • jsoncpp rapidjson
  • bash特殊符号
  • android studio警告
  • 基础的重要性
  • [置顶]星陨计划
  • 委托代销清单怎么写
  • 转让土地的土地增值税
  • 满五唯一是指省内还是本市
  • 西安税务总局
  • 企业2017年
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设