位置: 编程技术 - 正文

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

编辑:rootadmin
imagewebp

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

文章相关热门搜索词:php imagettftext,php imagestring,php imagestring,php img,php img,php img,php imagefill,php image,内容如对您有帮助,希望把文章链接给更多的朋友!

(PHP 5 >= 5.5.0)

imagewebp — 将 WebP 格式的图像输出到浏览器或文件

说明 bool imagewebp ( resource $image , string $filename )

将 image 参数指定的图像以 WebP 格式输出到浏览器或者保存到文件。

参数

imagePHP:imagewebp()的用法_GD库图像处理函数(php img)

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

filename

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

返回值

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

范例

Example #1 保存为 WebP 图像文件

<?php//创建一个空图像并在其上加入一些文字$im=imagecreatetruecolor(,);$text_color=imagecolorallocate($im,,,);imagestring($im,1,5,5,'WebPwithPHP',$text_color);//保存图像imagewebp($im,'php.webp');//释放内存imagedestroy($im);?>

PHP:imagetypes()的用法_GD库图像处理函数 imagetypes(PHP4=4.0.2,PHP5)imagetypes返回当前PHP版本所支持的图像类型说明intimagetypes(void)本函数以比特字段方式返回与当前PHP版本关联的GD库所支持的图像格式

PHP:imagestring()的用法_GD库图像处理函数 imagestring(PHP4,PHP5)imagestring水平地画一行字符串说明boolimagestring(resource$image,int$font,int$x,int$y,string$s,int$col)imagestring()用col颜色将字符串s画到image所代表的图

PHP:imagesy()的用法_GD库图像处理函数 imagesy(PHP4,PHP5)imagesy取得图像高度说明intimagesy(resource$image)imagesy()返回image所代表的图像的高度。Example#1使用imagesy()?php//createa*image$img=imagecreatetruecolor(

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

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

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

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

鄂ICP备2023003026号

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

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