位置: 编程技术 - 正文

PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge)

编辑:rootadmin
imagefttext

推荐整理分享PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php imagecopymerge,php imagestring,php imagecopymerge,php中imagecreatefromjpeg,php中imagecreatefromjpeg,php imagefill,php imagefill,php imagettftext,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.0.7, PHP 5)

imagefttext — 使用 FreeType 2 字体将文本写入图像

说明 array imagefttext ( resource $image , float $size , float $angle , int $x , int $y , int $color , string $fontfile , string $text [, array $extrainfo ] ) 参数

image

由图象创建函数(例如imagecreatetruecolor())返回的图象资源。

size

The font size to use in points.

angle

The angle in degrees, with 0 degrees being left-to-right reading text. Higher values represent a counter-clockwise rotation. For example, a value of would result in bottom-to-top reading text.

x

The coordinates given by x and y will define the basepoint of the first character (roughly the lower-left corner of the character). This is different from the imagestring(), where x and y define the upper-left corner of the first character. For example, "top left" is 0, 0.

y

The y-ordinate. This sets the position of the fonts baseline, not the very bottom of the character.

color

The index of the desired color for the text, see imagecolorexact().

fontfile

The path to the TrueType font you wish to use.

PHP:imagefttext()的用法_GD库图像处理函数(php imagecopymerge)

Depending on which version of the GD library PHP is using, when fontfile does not begin with a leading / then .ttf will be appended to the filename and the library will attempt to search for that filename along a library-defined font path.

When using versions of the GD library lower than 2.0., a space character, rather than a semicolon, was used as the &#;path separator&#; for different font files. Unintentional use of this feature will result in the warning message: Warning: Could not find/open font. For these affected versions, the only solution is moving the font to a path which does not contain spaces.

In many cases where a font resides in the same directory as the script using it the following trick will alleviate any include problems.<?php//SettheenviromentvariableforGDputenv('GDFONTPATH='.realpath('.'));//Namethefonttobeused(notethelackofthe.ttfextension)$font='SomeFont';?>

text

Text to be inserted into image.

extrainfo

Possible array indexes for extrainfo Key Type Meaning linespacing float Defines drawing linespacing

返回值

This function returns an array defining the four points of the box, starting in the lower left and moving counter-clockwise: 0 lower left x-coordinate 1 lower left y-coordinate 2 lower right x-coordinate 3 lower right y-coordinate 4 upper right x-coordinate 5 upper right y-coordinate 6 upper left x-coordinate 7 upper left y-coordinate

范例

Example #1 imagefttext() example

<?php//Createaximage$im=imagecreatetruecolor(,);$red=imagecolorallocate($im,0xFF,0x,0x);$black=imagecolorallocate($im,0x,0x,0x);//Makethebackgroundredimagefilledrectangle($im,0,0,,,$red);//Pathtoourttffontfile$font_file='./arial.ttf';//Drawthetext'PHPManual'usingfontsizeimagefttext($im,,0,,,$black,$font_file,'PHPManual');//Outputimagetothebrowserheader('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:imagegrabwindow()的用法_GD库图像处理函数 imagegrabwindow(PHP5=5.2.2)imagegrabwindowCapturesawindow说明resourceimagegrabwindow(int$window_handle[,int$client_area=0])Grabsawindoworitsclientareausingawindowshandle(HWNDpropertyinCOMinstance)

PHP:imagegrabscreen()的用法_GD库图像处理函数 imagegrabscreen(PHP5=5.2.2)imagegrabscreenCapturesthewholescreen说明resourceimagegrabscreen(void)Grabsascreenshotofthewholescreen.返回值Returnsanimageresourceidentifieronsuccess,FALSEonfailure.

PHP:imagegd()的用法_GD库图像处理函数 imagegd(PHP4=4.0.7,PHP5)imagegd将GD图像输出到浏览器或文件说明boolimagegd(resource$image[,string$filename])imagegd()将一个GD图像输出到filename。image参数是由imagecreatetrueco

标签: php imagecopymerge

本文链接地址:https://www.jiuchutong.com/biancheng/288335.html 转载请保留说明!

上一篇:PHP:imagegif()的用法_GD库图像处理函数(php中imagecreatefromjpeg)

下一篇:PHP:imagegrabwindow()的用法_GD库图像处理函数

  • 发票没有申报能开票吗
  • 税额怎么调整
  • 车船税是什么意思图片
  • 出租车定额发票真伪查询
  • 固定资产盘盈为什么计入盈余公积
  • 已勾选未认证什么意思
  • 固定资产明细账怎么填
  • 新企业如何办理税务登记
  • 物流公司加油费属于什么费用
  • 折价购入
  • 税率调整之后税额的差异
  • 即征即退增值税需要缴纳所得税吗
  • 个人所得税0申报逾期
  • 现代服务业要满足什么条件才转一般纳税人
  • 土地使用权出让和划拨有什么区别
  • 苗木增值税发票税率
  • 金税盘开票时间不对怎么办
  • 人工费用占销售收入比重
  • 年报填写中,认缴出资时间怎么填?
  • 电子发票真伪查询
  • 公司为员工交的五险一金到底是怎么回事
  • 无偿取得票据的持票人不享有追索权
  • 公司注销固定资产如何处理
  • 网上抵扣发票操作
  • 参加抽奖活动中奖却不发奖品
  • 受委托研发企业可以享受研发支出吗
  • 其他流动负债有利息吗
  • 事业单位年终事迹材料
  • 公司之间可以借款吗怎么做账
  • 公司主要开支是指什么
  • win7系统不可用怎么办
  • 担保公司的会计分录
  • 减免增值税会计处理
  • 一维卷积padding
  • 应收账款占用资金的应计利息变动额
  • 深入理解php中的数字
  • 盘点那些神级翻唱现场
  • 人脸检测5种方式
  • 发票错开退税款什么时候退回
  • 小企业会计准则调整以前年度费用分录
  • 企业所得税报表怎么更正
  • 员工垫付公司的保险费
  • phpcms 1064错误的解决办法
  • 帝国cms如何使用
  • 以前年度损益调整在利润表中怎么填
  • 员工垫付费用怎么做账
  • 研发费用不能加计扣除的有哪些项目
  • 将自产产品用于管理部门 增值税
  • 其他业务收入如何填写申报表
  • 免费赠送客户入群的文案
  • 购入固定资产的现金流量项目
  • 售后服务期多久
  • 年末转出未交增值税借方余额怎么处理
  • 研发阶段的产品质检要参与
  • 业务员出差借款,用途写什么
  • 缴纳社保记账凭证怎么开
  • 应付账款一直挂着,怎么消掉
  • 年末待处理财产损益有余额怎么办
  • 会计基本前提包括会计主体货币计量资料完整和经济效益
  • 财务章和公章的样式区别图片
  • centos 6.5下 mysql-community-server. 5.7.18-1.el6安装
  • Win10系统中怎么将文件夹进行压缩
  • 自动启动win10
  • Win10 Mobile/WP8.1优秀专业摄影应用OneShot本周再次更新:修复Bug和优化性能
  • redhat linux6.5安装教程
  • mac读取光驱
  • cocos2dx官方文档
  • cocos2dx开发的游戏
  • perl中qw
  • css制作热点新闻板块
  • 谈谈网页设计中的内容
  • Android - Designtime Layout Attributes & Tools Attributes
  • 下载python教程
  • mongoose python
  • tomcat8.5.8
  • python黑魔法手册
  • 公司开票明细如何查询
  • 长安cs752016款2.0手动
  • 开红酒增值税票怎么开
  • 税控盘打不开
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设