位置: 编程技术 - 正文

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

  • 实收资本印花税按次还是按年
  • 小规模纳税人印花税怎样计算
  • 应纳税额减征额包括哪些内容
  • 劳务费计入职工薪酬吗
  • 法人章和财务章谁保管
  • 非流动资产处置损失包括哪些
  • 房地产开发的会计处理
  • 怎么查纳税人信用等级
  • 会计核算原则主要包括
  • 没开发票可以确认收入吗?
  • 制造费用包括哪三类
  • 公司自建厂房需要缴纳哪些税
  • 净资产合计低于实际收益
  • 收到网站招聘费专票如何做账务处理?
  • 开个人普发票需要什么资料?
  • 个体户转让房产所得如何申报个人所得税
  • 钢结构安装有哪些工种
  • 通讯费企业所得税
  • 费用类有什么科目
  • 本期增加固定资产原值
  • 建筑行业外经证办理步骤
  • 小企业的费用应当在发生时计入当期损益
  • 多交的公积金怎么退回来
  • 农副产品的进项税额
  • 客户扣了一部分不合格产品的货款,请问如何做账呢?
  • 事业单位福利发放时间
  • 企业福利费支出范围
  • win10右键显示设置打不开怎么办
  • 计提个体户经营所得税
  • php获取文件名
  • 工商注册经营部和公司的区别
  • 水资源税收费标准
  • php框架symfony
  • 若依框架前端如何通过后端加载页面
  • php取二维数组的一组内容
  • 申请个人所得税
  • 法院判定支付对方诉讼费,我可以入账吗
  • python去掉文本的指定符号
  • 产品结转基本步骤有哪些
  • 会计要考哪些证书,难度如何
  • dedecms使用教程
  • sql server功能介绍
  • 坏账准备计提额怎么计算
  • 认缴制和实缴制的区别公司破产
  • 下列支出计入销售费用账户借方的是
  • ibm db2认证
  • 个人独资企业购入设备可以一次性计提吗
  • 专票时限是多长时间的
  • 购买电脑一次性计入费用吗合理吗
  • 生产出口退税企业有哪些
  • 一般纳税人房租租赁费的税率
  • 商标使用权入股要交税吗
  • 接受非货币性资产捐赠入账价值
  • 242104 税控盘
  • 其他业务收入在资产负债表哪里体现
  • XP系统怎么升级win10
  • 宏基笔记本电脑质量怎么样
  • Win8系统网络SSID怎么设置?Win8设置网络SSID的方法
  • win7右下角小喇叭
  • js如何使用
  • JavaScript中的变量名不区分大小写
  • 批处理有何限制
  • 学习雷锋好榜样
  • python用于读取文本文件内容的方法
  • python第三方库在哪下载
  • windows、linux
  • jQuery实现checkbox列表的全选、反选功能
  • 2020 unity
  • JavaScript中Math.SQRT2属性的使用详解
  • javascript编程软件
  • 烟叶处理
  • 人事科负责人是否必须是党员?
  • 山西国家税务总局官网
  • 为构建和谐企业
  • 不用税控盘可以清卡吗
  • 河北个体工商户年报入口
  • 区里的地税局局长是谁
  • 财政法和经济法的关系
  • 加油账单怎么查询
  • 贵州地税电话
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设