位置: 编程技术 - 正文

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的发票长啥样
  • 个税系统经营所得如何添加人员信息
  • 自然人独资公司和个人独资企业区别
  • 小规模纳税人增值税优惠政策2023
  • 取得保险赔偿的会计分录
  • 银行询证函费用计入财务费用还是管理费用
  • 收到子公司税后利润
  • 扣除工资作为违约金
  • 公司交增值税的好处
  • 房租合同印花税的计税依据怎么算
  • 微税平台抄税的步骤是怎样的?
  • 领钱签字表格模板图片
  • 税控盘月度统计表怎么打印
  • 财税〔2017〕39号
  • 减值准备可以转回是什么意思
  • 小规模纳税人如何转一般纳税人
  • 非营利组织免税收入孳生的银行存款利息
  • 材料采购差异的影响因素
  • 开出去的发票没有进项发票应怎么核算成本?
  • 支付宝支付凭证图片
  • sbsetup.exe - sbsetup是什么进程 有什么用
  • php定义的异常
  • sk是什么软件的缩写
  • 点云目标检测数据集
  • 常用的php操作mysql的函数有哪些
  • 固定资产投资账务处理
  • 头歌java第一课
  • 房地产开发企业增值税怎么算
  • 金门大桥和马林大桥区别
  • 未确认融资费用账务处理
  • 房产前期开发
  • 前端实际开发
  • python制作chm
  • powercfg off
  • 适用于windows7的更新程序会更新到windows10吗
  • vue组件怎么使用
  • 企业年报经营状态
  • 不同情况不同处理的句子
  • 企业注销时应收账款需要交税吗
  • 暂估入库有风险吗
  • 发票金额大于付款金额怎么做分录
  • 增值税发票的认证
  • python2.7 协程
  • 个体户交个税新政策
  • 合同取得成本的账务处理
  • 收到银行贷款发放成功的短信
  • 装潢装修费用属于营改增
  • 公司代缴社保生育津贴大概领多少
  • 从公司账户转给他人私户1万元以内需要扣多钱的税
  • 考核奖金属于工资吗
  • 原始凭证和记账凭证的区别
  • 测试费几分钱入账
  • 小规模纳税人开具的农产品普通发票
  • 如何避免电子发票重复报销的情况
  • 在哪找从平台消费的人
  • 企业应收账款的事前管理包括
  • 外账会计做什么
  • ubuntu15.10中文版
  • mac电脑安装软件未受信任
  • window怎么开启自动更新
  • windows8.1关闭开机密码
  • windows更新某些设置由你的组织来管理是什么意思
  • win7系统如何修改默认浏览器
  • Linux系统中如何复制虚拟机
  • win10系统附件在哪里
  • win8.1如何快速启动
  • cocos2d游戏引擎
  • CCProgressTimer 进度条动画在cocos2dx+lua中的使用
  • 手游频繁崩溃怎么解决
  • 网页css加载失败
  • js对象类
  • 安卓 自动化app
  • 铁岭医保网上怎么交费
  • 上海市浦东新区人民医院
  • 内江市税务局
  • 翡翠是否交消费税
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设