位置: 编程技术 - 正文

PHP:imagegd2()的用法_GD库图像处理函数(php imagettftext()函数)

编辑:rootadmin
imagegd2

推荐整理分享PHP:imagegd2()的用法_GD库图像处理函数(php imagettftext()函数),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:php imagecopymerge,php imgick,php imagettftext()函数,php imagettftext()函数,php imagettftext()函数,php imagestring,php imagettftext()函数,php中imagecreatefromjpeg,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 4 >= 4.0.7, PHP 5)

imagegd2 — 将 GD2 图像输出到浏览器或文件

说明 bool imagegd2 ( resource $image [, string $filename [, int $chunk_size [, int $type = IMG_GD2_RAW ]]] )

imagegd2() 将一个 GD 图像输出到 filename。image

参数

image

由图象创建函数(例如imagecreatetruecolor())返回的图象资源。

filename

文件保存的路径,如果未设置或为 NULL,将会直接输出原始图象流。

chunk_size

Chunk size.

type

可以是 IMG_GD2_RAW 或 IMG_GD2_COMPRESSED。默认为 IMG_GD2_RAW。

返回值 PHP:imagegd2()的用法_GD库图像处理函数(php imagettftext()函数)

成功时返回 TRUE, 或者在失败时返回 FALSE。

范例

Example #1 输出一个 GD2 图像

<?php//Createablankimageandaddsometext$im=imagecreatetruecolor(,);$text_color=imagecolorallocate($im,,,);imagestring($im,1,5,5,"ASimpleTextString",$text_color);//Outputtheimageimagegd2($im);//Freeupmemoryimagedestroy($im);?>

Example #2 保存 GD2 图像

<?php//Createablankimageandaddsometext$im=imagecreatetruecolor(,);$text_color=imagecolorallocate($im,,,);imagestring($im,1,5,5,"ASimpleTextString",$text_color);//Savethegd2image//ThefileformatforGD2imagesis.gd2,

注释

Note: 此函数需要 GD 2.0.1 或更高版本(推荐 2.0. 及更高版本)。

Note:

GD2 格式一般是用来加载图像中的一部分时更快。注意 GD2 格式只能用于兼容于 GD2 的应用程序。

更新日志

版本 说明 4.3.2 添加了参数 chunk_size 和 type。

参见

imagegd() - 将 GD 图像输出到浏览器或文件

PHP:imageftbbox()的用法_GD库图像处理函数 imageftbbox(PHP4=4.0.7,PHP5)imageftbbox给出一个使用FreeType2字体的文本框说明arrayimageftbbox(float$size,float$angle,string$fontfile,string$text[,array$extrainfo])Thisfunctioncalculatesan

PHP:imagegammacorrect()的用法_GD库图像处理函数 imagegammacorrect(PHP4,PHP5)imagegammacorrect对GD图像应用gamma修正说明boolimagegammacorrect(resource$image,float$inputgamma,float$outputgamma)imagegammacorrect()函数用给定的输入gamma

PHP:imagefontwidth()的用法_GD库图像处理函数 imagefontwidth(PHP4,PHP5)imagefontwidth取得字体宽度说明intimagefontwidth(int$font)返回指定字体一个字符宽度的像素值。参见imagefontheight()和imageloadfont()。

本文链接地址:https://www.jiuchutong.com/biancheng/288339.html 转载请保留说明!

上一篇:PHP:imagegd()的用法_GD库图像处理函数(php image)

下一篇:PHP:imageftbbox()的用法_GD库图像处理函数(php imagettftext)

免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

鄂ICP备2023003026号

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

友情链接: 武汉网站建设 电脑维修 湖南楚通运网络