位置: 编程技术 - 正文

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

  • 税务局代个人开票
  • 在业跟续存有什么不一样
  • 异地预缴怎么做账
  • 网上银行回单是什么意思
  • 混凝土开票的型号规格
  • 收到税收返还会计分录
  • 外购已税什么意思
  • 发票过期了还能抵扣吗
  • 商贸企业增值税优惠政策
  • 印花税,车船税通过应交税金科目吗
  • 多交印花税申请怎么写
  • 收地方工会的专用发票
  • 所得税网上申报表
  • 公司客车高速费如何抵扣进项税?
  • 抵扣税款是什么意思呢
  • 二手房房产税如何征收
  • 自有房产墙面出租,需要缴纳房产税吗?
  • 24个问题
  • 公司用自己的设备投资怎么交税呢怎么做账
  • 过路费企业所得税汇算清缴计入什么科目?
  • macbookpro提醒事项
  • 进项税转出怎么填报表
  • 报销招待费的会计怎么做
  • 个人出租住宅需要交哪些税
  • ae应用程序无法启动
  • windows 10 build 21354
  • 息税前利润和税前净利润的关系
  • postman如何设置token
  • 最高像素的镜头是多少
  • php files
  • 租金收入计入收入总额吗
  • php有面向对象吗
  • php远程下载源码
  • 前端vue3
  • 当月没有生产情况正常吗
  • 前端高手
  • vue2计算属性和vue3的计算属性的区别
  • bind函数错误
  • 物流公司修理班的管理有那些书
  • 工会会费收取
  • 现金流量表本月数和本年累计数是相等的么
  • 财务报表逾期了两个月有罚款吗
  • spring 门面模式
  • 5万元买二手车能买什么价位的车
  • 固定资产指的是几年度
  • 公司租赁职工车辆账务处理
  • 房地产开发公司注册条件
  • 会计 借方 贷方
  • 母公司溢价收购子公司
  • 红字发票异常处理什么意思
  • 付给销售人员的佣金会计分录
  • 公司买汽车计入什么费用
  • 开票信息指的是买方还是卖方
  • 研发费用资本化条件
  • 固定资产计提折旧的会计科目
  • 设备融资租赁会上征信吗
  • mysql5.x升级到mysql5.7后导入之前数据库date出错的快速解决方法
  • linux中git命令
  • vpengine.exe进程
  • ubuntu操作系统入门
  • win8系统启动项在哪
  • ubuntu 20.04.1 lts
  • ios8.4.1完美越狱教程
  • unix和linux是使用较为广泛的多用户交互
  • .msc是什么文件
  • w8系统文件夹怎么设置密码
  • 黑白棋手机游戏
  • 深入linux内核架构与底层原理 pdf
  • macos安装过程
  • [置顶]公主大人接下来是拷问时间31
  • python matplotlab
  • js window.open如何带参数
  • linux中awk用法详解
  • 磁盘监视器在哪
  • lohd
  • Python的requests网络编程包使用教程
  • javascript如何写操作命令
  • 四川省成都市国池酒厂52度原浆多少钱一瓶
  • 如何认真贯彻落实中央八项规定,切实改进工作作风
  • steam充值码生成
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设