位置: 编程技术 - 正文

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

  • 计提的增值税
  • 短期借款的实际资金成本
  • 季报利润表本月金额和本年累计金额
  • 建筑公司租赁费会计分录
  • 出货一般要多久
  • 公司购买食品如何入账
  • 向个体工商户付款可以现金支付吗
  • 无形资产摊销月底最后一天怎么算
  • 以前年度多交的企业所得税怎么调整
  • 股东借给公司的钱怎么归还
  • 房屋租赁后转租合法吗
  • 企业进行税收筹划
  • 税费改革是什么
  • 支付税收罚款怎么算企业所得税
  • 哪些费用可以计入待摊费用
  • 别人的项目挂靠我公司怎么做账?
  • 退回多交的所得税怎么做分录小规模
  • 房地产企业汇算清缴报表
  • 企业交补充医疗保险
  • 企业购买银行理财会亏吗
  • 企业房租收入营改增
  • 投标标费退回怎么做分录
  • 制造业企业存货管理论文
  • 进项是普票销项是专票,怎么交税
  • 存货跌价准备的金额
  • windows版本比较
  • 补提去年所得税分录
  • 外贸公司收汇可以收运费吗
  • 电脑记事本在哪里打开
  • php最新动态
  • uefiu盘安装系统步骤win10
  • windows7电脑时间不对
  • php是基于
  • jquery编程
  • 未交增值税的核算方法
  • 动力和燃料的区别
  • 福利费入账要求
  • 视觉机械臂操作视频
  • tune a video:one-shot tuning of image diffusion models for text-to-video generation
  • 深度学习参数初始化(二)Kaiming初始化 含代码
  • 车船税是不是车损
  • 什么叫财政补助收入
  • 房屋维修费属于什么税收分类编码
  • 企业向个人借款利息如何缴纳增值税
  • 合作卖东西怎么分成
  • dedecms插件
  • python Timer定时器如何使用?
  • 直接人工费用属于产品成本吗
  • 怎么查询mysql sql_mode
  • 详解中国女足出线形势
  • 固定资产出售账面价值计入什么科目
  • 营销策划服务费属于什么服务
  • 公司安装监控属于什么费用
  • 计提工资申报个税
  • 用友T3怎么结转成本费用
  • 排污费征收范围包括
  • 安装设备是干嘛的
  • sql server 操作
  • select * from sp_who的解决方案
  • 虚拟机打开提示物理内存不足
  • bios报警声
  • 苹果电脑的重新启动在哪里
  • win10下如何安装vista
  • ubuntu开机密码不记得了
  • windows文件丢失怎么修复
  • window10稳定版
  • js声明数据类型
  • android开发工程师案例教程源码
  • perl 获取数据库查询结果
  • 一个简单的防偷技巧
  • js选择框全选
  • unicode编码实现方案
  • ruby元编程第二版
  • 国家税务总局广州市税务局
  • 年终绩效奖金发放方案
  • 餐饮业如何缴纳增值税
  • 农机作业服务费用 如何开发票
  • 大同地税局地址
  • 租了店面
  • 北京市生育津贴发放标准
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设