位置: 编程技术 - 正文

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

  • 印花税计提时应入什么科目
  • 建安增值税怎么计算
  • 金税四期上线了吗什么时候上线
  • 房地产项目转让条件
  • 管理费用借贷方都有,如何结转
  • 特殊性税务处理所得税怎么算
  • 2019年研发费用加计扣除标准
  • 公司转让住房是什么意思
  • 增值税逾期未申报的税务怎么处理
  • 税控软件维护
  • 捐赠利得会计分录
  • 房地产老项目增值税简易计税
  • 所得税弥补以前的利润
  • 税控盘年费去哪里交
  • 国税局可以开增值税专用发票吗
  • 税控盘抵减税款怎么转出会计分录
  • 具备以下条件
  • 以前年度损益调整属于哪类科目
  • 反映留存收益的账户
  • 怎么计算房地产成本单价
  • 房屋拆迁过渡费由哪个部门发
  • win10怎么清空
  • mac qq音乐怎么下载mp3格式的音乐
  • 苹果电脑如何缩小图片大小
  • 律师费能计入办公费用吗
  • 长期待摊费用2021
  • Omniserv.exe - Omniserv是什么进程 有什么用
  • 小黑马下载
  • 已付货款没有发票能做支出吗
  • 对于接受捐赠的固定资产,其成本应当依次按照
  • php vr
  • 年终奖一般发什么奖品
  • 水表同步
  • 工业企业应付会计工作内容
  • 利润分配弥补亏损会计分录
  • 新能源企业所得税税率是多少
  • 独立核算统负盈亏和独立核算自负盈亏的区别
  • 进项税不得抵扣的意思
  • vue组件引入外部js
  • 基于Python实现五大常用分类算法(原理+代码)
  • 云服务器可以一直开着吗
  • this.$router.push点了后hash地址改变了,页面却不跳转
  • es6promise的理解
  • 住宿专票可以抵增值税吗
  • 租赁店面没有发票违法吗
  • 小规模公司卖车怎么开票
  • 个人所得税经营所得税申报表A表
  • 合并范围外关联方需要函证吗
  • 利润表调整了资产负债表怎么调整
  • 减征增值税的会计科目
  • 发票冲红字蓝字怎么处理
  • 无形资产摊销完以后得账务处理
  • 年化收益率和年利率区别
  • 公司健身器材使用制度
  • 分期收款销售商品,收到本期贷款50万元
  • 提取备用金现金流量如何填写
  • 营销策划服务费属于什么服务
  • 生产车间的会计科目
  • 固定资产融资租出对应入账科目
  • 销售返利如何做账
  • mysql全部语法
  • sqlserver数据类型怎么用
  • win10累积更新 卡住
  • centos开机grub
  • win8 应用商店
  • win7怎么安装网络驱动程序
  • javascript:window.top.space_additem
  • nodejs客户端框架
  • 什么是自然数
  • nodejs操作mysql
  • 数据库的基本操作语句有哪些
  • ecmascript6 官方文档
  • unity只执行一次的方法
  • js实现文本框输入功能
  • python中的文件
  • 工会经费申报表在哪里查询
  • 如何查询以前月份发票超限量的申请
  • 运输费属于什么会计分录
  • 增值税电子普通发票和普通发票区别
  • 江苏税务局人工电话
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设