位置: 编程技术 - 正文

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

  • 消费税为什么是减
  • 社会团体所涉及的法律
  • 房租违约金收入怎么做账
  • 保本销售量的计算公式用安全边际率
  • 一般纳税人销售自己使用过的汽车
  • 权益法核算的好处
  • 存货内部交易抵消通俗讲解
  • 停工损耗会计分录怎么写
  • 个体工商户需要缴纳哪些税
  • 个人转租房屋需交税吗
  • 扶贫费用事业单位账务处理怎么做?
  • 当月忘记暂估怎么办
  • 记账凭证一定要签字吗
  • 个人怎么开增值税
  • 小规模收专用发票后成为一般纳税人吗
  • 提前收取租赁收入的财务处理
  • 如何利用成套消费品进行纳税筹划
  • 购买的商品入库会计分录怎么写
  • 二手房产增值税率
  • 购买汽车车辆购置税个人垫付,企业付给个人的附件归属
  • 员工工牌的作用
  • 政府高薪补贴
  • 逾期交房违约金怎么算
  • 受让股东对出让股东抽逃出资
  • 培训机构的收入有哪几方面
  • 服务器centos6.9安装教程
  • 使用PHP similar text计算两个字符串相似度
  • 方正书版10.0教程
  • 固态硬盘什么牌子性价比高
  • php ftp功能
  • phpmemcached使用
  • 委托加工应税消费品的纳税义务人是受托方
  • yolov5使用教程
  • 芬兰东部的国家有哪些
  • ai作画app
  • 参展费会计分录
  • react 路由参数
  • 出差补助需要发工资吗
  • 目标检测数据集
  • typescript tsconfig
  • thinkphp教程
  • 信用减值损失需要纳税调整吗
  • 员工报销车辆费怎么处理
  • 有外币账户的企业叫什么
  • 房地产业具体怎么做
  • 发票上盖成财务章了怎么办
  • 公司缴纳的残保金是什么
  • 电梯折旧率多少
  • 应收账款计提减值准备会计处理
  • 税盘减免税款怎么做账
  • 行政转工会经费请示
  • 企业提取盈余公积的比例
  • 无发票的费用怎么算
  • 收到发票没付款,能打赢官司吗
  • 登记总分类账的依据有
  • 计提房产税的账务处理
  • 数据库中两张表tab1
  • 数据库中alter table的用法
  • iis w3svc
  • 如何制作ubuntu系统盘
  • ububtu安装教程
  • macbookair网页全屏
  • xp系统电源设置在哪里
  • icqlite.exe进程的详细介绍 icqlite进程的查询 作用是什么
  • win8.1系统安装
  • cocos2dx 3.4 Label中文显示
  • cocos2dx4.0教程
  • 相机渲染图片
  • 个人简历
  • cocos2d教程
  • javascript中的关键字有哪些
  • python静态函数
  • jquery页面布局
  • 重庆市国家税务局电子税务局官网
  • 南京税务局 局长
  • 如何在国税网上做企业会计制度备
  • 河北手工发票查验平台
  • 收到税务局发的多条宣传短信
  • 注册税务师考试时间2024
  • 营改增后的工程造价怎么算
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设