位置: 编程技术 - 正文

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

  • 计提税金账务处理
  • 手机里面的发票在哪里
  • 出租车手撕票可以换成增值税发票吗
  • 怎么查企业适用哪个会计制度教学视频
  • 报销用的发票抬头写什么
  • 税申报后未交款是否可撤销?
  • 社会保险申报表中工资总额累计金额是什么意思
  • 物流企业会计核算的主要内容
  • 公司清算后未处理财产
  • 刚成立公司没有报表怎么解释
  • 流动资产周转次数低说明什么
  • 招待费进项税如何抵扣
  • 中央空调 付款
  • 住宿费专用发票会计分录
  • 广告代理服务计入什么费用
  • 自己的公司钱能自己用吗
  • 经营性租入的固定资产需要计提折旧吗
  • 旅游门票报销怎么算
  • 财产转移数据缴费怎么交
  • 基本社会保障性缴款包括什么
  • 利润分成的会计分录
  • 给对方发短信显示imessage
  • 网速检测工具
  • 平均应收账款是什么
  • php cgi配置
  • 上月暂估成本高了这个月怎么做账
  • 系统太多怎么办
  • php数组函数实现机选双色球
  • 增值税发票可以抵扣多少
  • svchost一直在下载什么
  • 销售收入与销售成本
  • 只用vue可以做网站不?
  • 什么是社保差额
  • JS之location对象详解
  • 以摊余成本计量和以公允价值计量的区别
  • 移动端适配 px
  • Python列表元素的删除
  • 小规模企业应交税费
  • 招待费发票怎么做分录
  • 其他权益工具投资是金融资产吗
  • wordpress加速
  • 应收账款与营业收入比例分析
  • 已缴款未入库是缴费成功了吗
  • 印花税计提怎么做分录
  • 企业借入长期借款的用途主要有
  • 企业季度所得税申报流程
  • 个人所得税表格怎么做
  • access数据保存
  • 成本核算分摊方法总结
  • 合伙律师事务所管理办法最新
  • 没有收到房租发票
  • 公司部门财务单独核算
  • 保教费免征增值税政策
  • 应付职工薪酬代扣社保
  • 存货报废的会计分录怎么做
  • 网上订机票怎么拿报销凭证
  • 企业搬迁安置费一般怎么赔
  • 股权变更需要做账吗
  • 库存现金期末余额在哪方
  • 年末本年利润没有结转影响报税吗
  • 明细分类账表格
  • sql server ceiling
  • mac快速关闭所有窗口
  • 重装xp系统进不去
  • linux route -n命令结果详解
  • Ubuntu中Virtualbox虚拟机NAT方式无法上网解决方法
  • sstray.exe - sstray是什么进程 有什么作用
  • 进程 com surrogate
  • win8怎样获取管理员权限
  • win8无法识别存档文件
  • linux系统查询进程
  • cocos2dx 3.3 tilemap 缩放滑动并且准确点击对象
  • 用来检测程序小错误的测试方法
  • table标签怎么设置宽高
  • unity总结
  • html标签页效果
  • android内存优化三 简书
  • JavaScript+html5 canvas制作的圆中圆效果实例
  • 纳税申报指什么意思
  • 在深圳月薪8000是什么水平
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设