位置: 编程技术 - 正文

PHP:imagecreatefromgd2part()的用法_GD库图像处理函数

编辑:rootadmin
imagecreatefromgd2part

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

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

(PHP 4 >= 4.0.7, PHP 5)

imagecreatefromgd2part — 从给定的 GD2 文件或 URL 中的部分新建一图像

说明 resource imagecreatefromgd2part ( string $filename , int $srcX , int $srcY , int $width , int $height )

Create a new image from a given part of GD2 file or URL.

Tip

如已启用fopen 包装器,在此函数中, URL 可作为文件名。关于如何指定文件名详见 fopen()。各种wapper 的不同功能请参见 支持的协议和封装协议,注意其用法及其可提供的预定义变量。

参数

filename

Path to the GD2 image.

srcX

x-coordinate of source point.

srcY PHP:imagecreatefromgd2part()的用法_GD库图像处理函数

y-coordinate of source point.

width

源图象的宽度。

height

源图象的高度。

返回值

成功后返回图象资源,失败后返回 FALSE 。

范例

Example #1 imagecreatefromgd2part() example

<?php//Forthisexampleweneedtheimagesizebefore$image=getimagesize('./test.gd2');//Createtheimageinstancenowwegottheimage//sizes$im=imagecreatefromgd2part('./test.gd2',4,4,($image[0]/2)-6,($image[1]/2)-6);//Doanimageoperation,inthiscaseweembossthe//imageifPHP5+if(function_exists('imagefilter')){imagefilter($im,IMG_FILTER_EMBOSS);}//Saveoptimizedimageimagegd2($im,'./test_emboss.gd2');imagedestroy($im);?>

注释

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

Warning

Windows 版本的 PHP 在 4.3.0版之前不支持通过此函数访问远程文件,即使已经启用 allow_url_fopen.

PHP:imagecreatefromgd2()的用法_GD库图像处理函数 imagecreatefromgd2(PHP4=4.0.7,PHP5)imagecreatefromgd2从GD2文件或URL新建一图像说明resourceimagecreatefromgd2(string$filename)从GD2文件或URL新建一图像。Tip如已启用fopen包装器

PHP:imagecolortransparent()的用法_GD库图像处理函数 imagecolortransparent(PHP4,PHP5)imagecolortransparent将某个颜色定义为透明色说明intimagecolortransparent(resource$image[,int$color])imagecolortransparent()将image图像中的透明色设

PHP:imagecopy()的用法_GD库图像处理函数 imagecopy(PHP4,PHP5)imagecopy拷贝图像的一部分说明boolimagecopy(resource$dst_im,resource$src_im,int$dst_x,int$dst_y,int$src_x,int$src_y,int$src_w,int$src_h)将src_im图像中坐标从src_x,

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

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

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

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

鄂ICP备2023003026号

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

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