位置: 编程技术 - 正文

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

  • 劳务报酬收入是否含税
  • 印花税技术合同计税依据
  • 会计账册丢失什么后果
  • 不同月份的发票能抵扣吗
  • 劳务派遣员工工伤用工单位承担责任吗
  • 在建工程处置通过固定资产清理吗
  • 个体户个人经营所得税税率表2023
  • 有没有退股一说
  • 个体户定期定额是什么意思
  • 房产企业赠送无形资产
  • 出口货物补税申报表
  • 适用于6%税率的优惠
  • 公司电话费用
  • 支付境外销售佣金是不是属于完全在境外发生的服务
  • 发票额开多了多出的金额怎么处理?
  • 生产成本里面的工会经费
  • 开具发票财务需要管理吗?
  • 汽车销售服务费话术
  • 中小企业代扣代缴增值税抵扣时限
  • 公司买厨房用品计入什么科目
  • 税务师如何办理入会
  • 苹果手机升级微信版本
  • smss.exe是干嘛的
  • PHP:mb_convert_encoding()的用法_mbstring函数
  • 先出库还是先开票
  • 期间损益的科目
  • 外销收入含税吗
  • 追加投资会增加实收资本吗
  • 事业单位利息收入
  • vrvarp.exe是什么
  • 长期股权投资初始计量和后续计量的区别
  • 月初在产品成本+本月生产费用
  • php读取txt文件内容
  • 如何计提加计抵减额分录
  • 个体户跟企业户
  • yii2带搜索功能的下拉框实例详解
  • 其他综合收益科目有哪些
  • vue面试题及答案2021
  • php curl_exec
  • 勘察设计费是否含税
  • 科目汇总表一张不够怎么写下一页
  • 串口发送字节数据的数据格式是什么
  • SQL Server 使用 SET FMTONLY ON 获得表的元数据
  • 合伙企业费用汇总表
  • 报废的固定资产清理的净损失计入营业外支出
  • 冲减当期利润
  • 收到银行手续费发票怎么入账
  • 调整期初库存商品分录
  • 工业用电交税怎么算
  • 固定资产的后续计量
  • 企业如何运用内部招募
  • 技术服务费怎么交税
  • 小规模纳税人收入不能超过多少
  • 转账支票一定要填写支付密码吗?
  • 出口视同内销如何申报?
  • 合并编制报表主要有哪几种
  • sql server的主数据库是( )
  • mac上怎么截图
  • win7旗舰版系统激活码
  • centos设置终端快捷键
  • Windows XP Vista 2006 简体中文版下载
  • 在对linux系统中dir
  • Cocos2d-x 3.x lua绑定
  • LayoutInflater.inflate方法解析
  • qt for 安卓
  • shell脚本 定义变量
  • nodejs前后端数据交互
  • Node.js中的全局变量有哪些
  • system命令行
  • 百度关键字搜索员是干嘛的
  • nodejs tcp
  • install ubuntu kylin
  • 用js设置颜色
  • Android4.4 wpa_supplicant深入分析之wpa_supplicant初始化流程续
  • 用javascript
  • javascript整数类型
  • 微博html代码
  • 税务局投诉举报
  • 企业个税网上申报时间
  • 印花税为什么不计入资产成本
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设