位置: 编程技术 - 正文

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

  • 年应税销售额是利润表中的营业收入吗
  • 新车车船税怎么交
  • 保险公司车险理赔款如何入账
  • 有形动产租赁属于营改增吗
  • 怎么查企业适用哪个会计制度教学视频
  • 出口退税不退税主要适用于
  • 已扣缴税额
  • 企业所得税季度预缴怎么计算
  • 印花税申报成功后在哪里查询
  • 补提以前年度税费应该计入
  • 付款方式公对公什么意思
  • 公司承揽员工租房个税如何入账?
  • 税审需要什么资料和材料
  • 销项负数发票怎么冲减成本
  • 个人所得税承租承包经营所得
  • 开个人发票需要身份证号码吗
  • 个体户需要申报工资薪金吗
  • 外币业务汇兑损益根据业务划分为
  • 出口退税系统中的出口货物已补税未退税证明怎么填
  • saproxy.exe - saproxy是什么进程 有什么用
  • 补助是按基本工资还是总工资
  • 细说linux
  • 怎么给自己的宽带改名字
  • jusched.exe是什么进程
  • 弥补以前年度亏损最多几年
  • 企业常见的筹资方式有几种
  • Symfony2实现在controller中获取url的方法
  • 一朵牛肝菌 (© vnosokin/Getty Images)
  • ajax的使用场景
  • 企业研发费用加计扣除是什么意思
  • vue 长列表优化
  • php数据库设计
  • adan算法
  • js中reduce用法
  • 30多岁应该怎么说
  • 归还长期借款会计分录例题
  • 支付货物运费计入什么科目
  • 不发工资可以交五险一金吗
  • saas web
  • 没有发票的费用汇算清缴的时候怎么调出来
  • python中的函数调用
  • 小企业会计准则主要按照什么计量
  • 金蝶财务软件怎么备份
  • 数据库参数错误
  • 个人账户用于公司发工资
  • 融资租赁开什么发票
  • sqlserver日期加减月份
  • 报关代理费进成本吗
  • 公司的房租发票怎么开
  • 赠送成本的会计分录
  • 企业所得税退税怎么操作
  • 物流公司的会计怎么样
  • 领用材料属于什么费用
  • 培训费发票必须开吗
  • 残保金什么时候截止
  • 旧账整理方案
  • 其他操作系统类型
  • 在u盘安装软件插上就能用
  • windows7怎
  • Win10打开设备管理器
  • fp3是什么文件格式
  • win8磁盘分区合并
  • kpg是什么文件
  • windows8主题桌面
  • 怎么关闭win10升级
  • linux awk nr
  • js必学知识点
  • 火狐浏览器自定义滚动条
  • javascript密码强度
  • Node.js中的construct
  • js跨域请求json数据
  • unity3d操作
  • JavaScript Array对象详解
  • nodejs和jsp
  • android:Background线程池和UiThread线程池
  • jquery ui dialog替代confirm实例分析
  • 江苏国税电子税务局怎么申报
  • 广州市税务局官网电话
  • 四川纳税互动平台app
  • 湖北税票真伪查询
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设